feat(cities): seed all Iran provinces and cities with tree hierarchy

This commit is contained in:
mahmood
2026-10-25 13:04:07 +03:30
parent af5095a0e3
commit bb281cc5d6
218 changed files with 30029 additions and 207 deletions
+1
View File
@@ -0,0 +1 @@
import{s as g,W as f,K as c,X as p,h as v,i as y,y as h}from"./index-Dnn4Ov4L.js";const S=g("catalog",()=>{const o=f(),n=o.peek(c.catalog),t=p(n??[]),s=v(n!==void 0),r=y(()=>{const e=new Map;for(const a of t.value)a.category&&!e.has(a.category.id)&&e.set(a.category.id,{id:a.category.id,title:a.category.title});return[...e.values()]});async function i(e=!1){const a=await o.fetch(c.catalog,async()=>(await h.listProductsPaged({page:1,limit:100,sort:"newest"})).rows,{force:e});return t.value=a,s.value=!0,a}function l(e){t.value=e,s.value=!0}function u(e){return t.value.find(a=>a.id===e)??null}function d(){o.invalidate(c.catalog)}return{products:t,loaded:s,categories:r,load:i,replace:l,byId:u,invalidate:d}});export{S as u};