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

7 lines
766 B
JavaScript

import{M as s,aq as r}from"./Cbt2tPBc.js";const i=async e=>(await s.from("collections").select("*").select("*").order("created_at",{ascending:!1})).data,o=async e=>{const{data:t,error:a}=await s.from("collections").select(`
id, title, parentId:parent_id, created_at,
children:collections!parent_id(
id, title, parentId:parent_id, created_at
)
`).is("parent_id",null);return t},d=async e=>{await r.fetch("collections","insert",{data:e})},l=async e=>{const{data:t,error:a}=await s.rpc("get_collection_descendants",{start_id:e});if(a)throw a;return t.map(c=>c.id)},u=async(e,t)=>r.fetch("collections","update",{data:t,field:"id",value:e}),p=async e=>r.fetch("collections","delete",{field:"id",value:e});export{l as a,o as b,d as c,p as d,i as g,u};