import{a as p}from"./chunk-R4XRTUBF.js";import{cc as m,db as s,eb as n,ec as a,k as e,q as u,t as h}from"./chunk-BYJPVSLE.js";var E=(()=>{class i{constructor(t){this.http=t,this.url=m.apiBaseUrl+"reviews/",this.carts=[]}get(t={}){let r=new s;return t.restaurant_id&&(r=r.set("restaurant_id",t.restaurant_id)),t.customer_id&&(r=r.set("customer_id",t.customer_id)),t.status&&(r=r.set("status",t.status)),t.query&&(r=r.set("query",t.query)),t.page&&(r=r.set("page",t.page)),t.per_page&&(r=r.set("per_page",t.per_page)),t.nopaginate&&(r=r.set("nopaginate",t.nopaginate)),this.http.get(`${this.url}`,{params:r}).pipe(e(a.handleError))}show(t){return this.http.get(this.url+t).pipe(e(a.handleError))}create(t){return this.http.post(this.url,p.toFormData(t)).pipe(e(a.handleError))}update(t){return this.http.post(this.url+t.id,p.toFormData(t)).pipe(e(a.handleError))}delete(t){return this.http.delete(this.url+t).pipe(e(a.handleError))}count(t={}){let r=new s;return t.restaurant_id&&(r=r.set("restaurant_id",t.restaurant_id)),this.http.get(`${this.url+"count"}`,{params:r}).pipe(e(a.handleError))}static{this.\u0275fac=function(r){return new(r||i)(h(n))}}static{this.\u0275prov=u({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();export{E as a};
