import{y as n,z as t}from"./index-Bodg7xX-.js";const d=n("admins",{state:()=>({admins:[],loading:!1,error:null}),actions:{async fetchAdmins(){var a,s;this.loading=!0,this.error=null;try{const{data:i}=await t.get("/admins");this.admins=i.admins}catch(i){this.error=((s=(a=i.response)==null?void 0:a.data)==null?void 0:s.message)||"Failed to load admins"}finally{this.loading=!1}},async createAdmin(a){const{data:s}=await t.post("/admins",a);return this.admins.push(s.admin),s.admin},async removeAdmin(a){await t.delete(`/admins/${a}`),this.admins=this.admins.filter(s=>s.id!==Number(a))}}});export{d as u};
