UNPKG

@lucidcms/core

Version:

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

2 lines 525 B
import e from"../../libs/repositories/media-folders.mjs";import t from"./checks/check-folder-access.mjs";const n=async(n,r)=>{let i=new e(n.db.client,n.config.db),a=await t(n,{folderId:r.parentFolderId});if(a.error)return a;let o=await i.createSingle({data:{title:r.title,tenant_key:n.request.tenantKey??null,parent_folder_id:r.parentFolderId??null,created_by:r.userId},returning:[`id`],validation:{enabled:!0}});return o.error?o:{error:void 0,data:o.data.id}};export{n as default}; //# sourceMappingURL=create-single.mjs.map