UNPKG

@lucidcms/core

Version:

The core of the Lucid CMS. It's responsible for spinning up the API and serving the CMS.

2 lines 688 B
import e from"../../libs/repositories/document-bricks.mjs";import{getBricksTableSchema as t}from"../../libs/collection/schema/runtime/runtime-schema-selectors.mjs";const n=async(n,r)=>{let i=new e(n.db.client,n.config.db),a=await t(n,r.collectionKey);if(a.error)return a;let o=a.data.filter(e=>e.type===`document-fields`||e.type===`brick`),s=[];for(let e of o)s.push(i.deleteMultiple({where:[{key:`document_id`,operator:`=`,value:r.documentId},{key:`document_version_id`,operator:`=`,value:r.versionId}]},{tableName:e.name}));let c=await Promise.all(s);for(let e of c)if(e.error)return e;return{error:void 0,data:void 0}};export{n as default}; //# sourceMappingURL=delete-multiple.mjs.map