import { HttpParams } from "@angular/common/http";
import { Injectable } from "@angular/core";
import { ListParams } from "@shared/paging/paging";

@Injectable({providedIn: 'root'})
export class ServicesUtils{
    getParamsFromModel(params:ListParams):HttpParams{
        let httpParams = new HttpParams();
        Object.entries(params).forEach(([key, value])=>{
            if(params != null && params!=undefined){
                httpParams = httpParams.set(key, String(value))
            }
        })
        return httpParams;
    }
}