2 lines
1.0 KiB
JavaScript
2 lines
1.0 KiB
JavaScript
import{a}from"./chunk-MBEC6LK4.js";import{Gc as r,H as i,Hc as o,M as s}from"./chunk-TVKQFRWX.js";var m=class n{http=s(o);baseUrl=`${a.apiUrl}/article-interactions`;getPublic(t,e){return this.http.get(`${this.baseUrl}/public/${encodeURIComponent(t)}`,{params:new r().set("visitorKey",e)})}toggleLike(t,e,c){return this.http.post(`${this.baseUrl}/public/${encodeURIComponent(t)}/like`,{articleTitle:e,visitorKey:c})}submitComment(t){return this.http.post(`${this.baseUrl}/public/comments`,t)}getAdminComments(t){let e=t?{params:new r().set("status",t)}:{};return this.http.get(`${this.baseUrl}/admin/comments`,e)}getPendingCount(){return this.http.get(`${this.baseUrl}/admin/comments/pending-count`)}moderateComment(t,e){return this.http.put(`${this.baseUrl}/admin/comments/${t}/status`,null,{params:new r().set("status",e)})}deleteComment(t){return this.http.delete(`${this.baseUrl}/admin/comments/${t}`)}static \u0275fac=function(e){return new(e||n)};static \u0275prov=i({token:n,factory:n.\u0275fac,providedIn:"root"})};export{m as a};
|