import{b as p}from"./chunk-HOI2FLSI.js";import{cc as u,db as s,eb as n,ec as i,k as e,q as o,t as h}from"./chunk-BYJPVSLE.js";var _=(()=>{class a{constructor(r){this.http=r,this.url=u.apiBaseUrl+"orders/"}get(r={}){let t=new s;return r.page&&(t=t.set("page",r.page)),r.per_page&&(t=t.set("per_page",r.per_page)),r.customer_id&&(t=t.set("customer_id",r.customer_id)),r.restaurant_id&&(t=t.set("restaurant_id",r.restaurant_id)),r.nopaginate&&(t=t.set("nopaginate",r.nopaginate)),this.http.get(`${this.url}`,{params:t}).pipe(e(i.handleError))}show(r){return this.http.get(this.url+r).pipe(e(i.handleError))}create(r){return this.http.post(this.url,p.toFormData(r)).pipe(e(i.handleError))}update(r){return this.http.post(this.url+r.id,p.toFormData(r)).pipe(e(i.handleError))}delete(r){return this.http.delete(this.url+r).pipe(e(i.handleError))}offercheck(r){return this.http.post(this.url+"offer-check",p.toFormData(r)).pipe(e(i.handleError))}reOrder(r){return this.http.get(this.url+"re-order/"+r).pipe(e(i.handleError))}static{this.\u0275fac=function(t){return new(t||a)(h(n))}}static{this.\u0275prov=o({token:a,factory:a.\u0275fac,providedIn:"root"})}}return a})();export{_ as a};
