import{_ as i}from"./Input.7105798b.js";import{bE as m,bF as _,aL as f,c as b,a as u,b as h,ba as v,ah as y,bD as x,o as g}from"./entry.816e6e91.js";import{u as E}from"./useToast.95f42666.js";const V={class:"p-3"},N={class:"bg-white p-2"},R={__name:"[id]",setup(k){const p=m(),r=_(),n=E(),s=f(""),d=async()=>{var t,o,l,c;const{data:e,pending:a}=await x({url:`products/types/update/${r.params.id}`,method:"post"},{body:{name:s.value,_method:"put"}});((t=e==null?void 0:e.value)==null?void 0:t.status)==1?(s.value="",p.push("/admin/products-types"),n.add({title:(o=e==null?void 0:e.value)==null?void 0:o.message})):((l=e==null?void 0:e.value)==null?void 0:l.status)===0&&n.add({title:(c=e==null?void 0:e.value)==null?void 0:c.message,color:"red"})};return(e,a)=>{const t=i;return g(),b("section",V,[u("div",N,[h(t,{modelValue:v(s),"onUpdate:modelValue":a[0]||(a[0]=o=>y(s)?s.value=o:null),label:"Name *",placeholder:"Name"},null,8,["modelValue"]),u("div",{class:"flex justify-end my-4"},[u("button",{onClick:d,class:"bg-[#FE564E] py-2 px-2 rounded-md text-white"}," Edit ")])])])}}};export{R as default};
