Files
appco_dist/.output/public/_nuxt/Bu1TSr4Z.js
T
2026-02-01 21:53:26 +03:30

2 lines
979 B
JavaScript

import{d as u,d0 as d,u as p,G as m,o as f,dp as _,aA as n,g,y as v,F}from"./CqMGdh3i.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"./BBQb2YCE.js";const y=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 v(),F(t)}}});export{y as _};