Files
appco_dist/.output/public/_nuxt/CLlsjMRD.js
T
2026-03-08 18:08:09 +03:30

7 lines
766 B
JavaScript

import{N as r,ar as s}from"./2b2DIrDg.js";const i=async e=>(await r.from("collections").select("*").select("*").order("created_at",{ascending:!1})).data,o=async e=>{const{data:t,error:a}=await r.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 s.fetch("collections","insert",{data:e})},l=async e=>{const{data:t,error:a}=await r.rpc("get_collection_descendants",{start_id:e});if(a)throw a;return t.map(c=>c.id)},u=async(e,t)=>s.fetch("collections","update",{data:t,field:"id",value:e}),p=async e=>s.fetch("collections","delete",{field:"id",value:e});export{l as a,o as b,d as c,p as d,i as g,u};