Files
appco_dist/.output/public/_nuxt/DAvFecQo.js
T
2026-01-27 16:02:45 +03:30

2 lines
984 B
JavaScript

import{d as u,d1 as d,u as p,G as m,o as f,dp as _,aA as n,g,F as v,z as F}from"./Cbt2tPBc.js";import{f as w,l as c,p as o,o as x,m as R,a as b,b as k,c as a,r as C}from"./C8NhlFLb.js";const B=u({__name:"index",setup(D){const s=d(),i=p(),l=m();return f(async()=>{if(w(s.name)){c.value=!0;let{product:e}=await _(s.params?.id);c.value=!1,o.value=n(e),e.original_image&&(x.value={url:l.useDataStorage(e.original_image),index:0}),e.files?.splice(0,1),e.files&&(R.value=e.files?.map((r,t)=>({url:l.useDataStorage(r.url),index:t+1}))),b.value=n(k.value),delete o.value.brands,delete o.value.comments,delete o.value.likes,Object.assign(a,o.value),a?.collections?.parent_id||(a.collections=a?.collections??{},a.collections.parent_id=a?.collections?.id,a.collections.id=void 0),await i.replace({name:"edit-product-id-infProduct",params:s.params})}else C(),await i.replace({name:"add-product-inputProduct",params:s.params})}),(e,r)=>{const t=g("RouterView");return F(),v(t)}}});export{B as _};