import{u as i,b as u,c as s}from"./vendor-query-B2UbickB.js";import{b as t}from"./index-BZu5zewH.js";function r(e={}){const n=new URLSearchParams;e.category&&n.set("category",e.category),e.search&&n.set("search",e.search),e.limit!=null&&n.set("limit",String(e.limit)),e.offset!=null&&n.set("offset",String(e.offset));const o=n.toString();return i({queryKey:["topics",e],queryFn:()=>t(`/topics${o?`?${o}`:""}`)})}function y(e){return i({queryKey:["topics","detail",e],queryFn:()=>t(`/topics/by-name/${encodeURIComponent(e)}`),enabled:!!e})}function m(){const e=u();return s({mutationFn:({topic:n,...o})=>t(`/topics/by-name/${encodeURIComponent(n)}`,{method:"PUT",body:JSON.stringify(o)}),onSuccess:()=>{e.invalidateQueries({queryKey:["topics"]})}})}function p(){const e=u();return s({mutationFn:n=>t(`/topics/by-name/${encodeURIComponent(n)}`,{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:["topics"]})}})}function d(){return s({mutationFn:({topic:e,data:n})=>t(`/topics/by-name/${encodeURIComponent(e)}/publish`,{method:"POST",body:JSON.stringify({data:n})})})}export{y as a,m as b,p as c,d,r as u};
//# sourceMappingURL=topics-DIziCjqg.js.map
