import{u as o,b as t,c as n}from"./vendor-query-B2UbickB.js";import{b as u}from"./index-BZu5zewH.js";function c(e={}){const s=new URLSearchParams;return e.role&&s.set("role",e.role),e.roleType&&s.set("roleType",e.roleType),e.status&&s.set("status",e.status),e.limit&&s.set("limit",String(e.limit)),e.offset!==void 0&&s.set("offset",String(e.offset)),o({queryKey:["users",e],queryFn:()=>u(`/users?${s}`)})}function m(e){return o({queryKey:["users",e],queryFn:()=>u(`/users/${e}`),enabled:!!e})}function d(){const e=t();return n({mutationFn:s=>u("/users",{method:"POST",body:JSON.stringify(s)}),onSuccess:()=>{e.invalidateQueries({queryKey:["users"]})}})}function l(){const e=t();return n({mutationFn:({id:s,...r})=>u(`/users/${s}`,{method:"PUT",body:JSON.stringify(r)}),onSuccess:()=>{e.invalidateQueries({queryKey:["users"]})}})}function f(){const e=t();return n({mutationFn:s=>u(`/users/${s}`,{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:["users"]})}})}function q(){const e=t();return n({mutationFn:({userId:s,role:r,type:i})=>u(`/users/${s}/roles`,{method:"POST",body:JSON.stringify({role:r,type:i})}),onSuccess:()=>{e.invalidateQueries({queryKey:["users"]})}})}function S(){const e=t();return n({mutationFn:({userId:s,role:r})=>u(`/users/${s}/roles/${encodeURIComponent(r)}`,{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:["users"]})}})}export{m as a,d as b,l as c,q as d,S as e,f,c as u};
//# sourceMappingURL=users-CMGaVe_B.js.map
