import{a as e,g as t,s as n,t as r}from"./api-Duu96wkE.js";import{G as i}from"./index-DyQEyT-0.js";var a={all:[`employees`],list:e=>[`employees`,`list`,e],detail:e=>[`employees`,e]};function o(n){return e({queryKey:a.list(n),queryFn:async()=>{let e=await r.get(`/employees`,{params:n});return{employees:e.data.data,meta:e.data.meta}},placeholderData:t})}function s(t){return e({queryKey:a.detail(t??``),queryFn:async()=>(await r.get(`/employees/${t}`)).data.data,enabled:!!t})}function c(e){let t=n();return i({mutationFn:async t=>(e?await r.patch(`/employees/${e}`,t):await r.post(`/employees`,t)).data.data,onSuccess:e=>{t.invalidateQueries({queryKey:a.all}),t.setQueryData(a.detail(e.id),e)}})}export{o as n,c as r,s as t};