@lucidcms/core
Version:
The core of the Lucid CMS. It's responsible for spinning up the API and serving the CMS.
2 lines • 685 B
JavaScript
import e from"../../utils/helpers/get-base-url.mjs";import t from"../../libs/repositories/document-workflows.mjs";import n from"../collections/get-single-instance.mjs";import{getWorkflowConfig as r}from"./helpers/index.mjs";import i from"../../libs/formatters/document-workflows.mjs";const a=async(a,o)=>{let s=n(a,{key:o.collectionKey});if(s.error)return s;if(!r(s.data))return{error:void 0,data:null};let c=await new t(a.db.client,a.config.db).selectSingleDetailed({collectionKey:o.collectionKey,documentId:o.documentId});return c.error?c:{error:void 0,data:i.formatSingle({collection:s.data,workflow:c.data,host:e(a)})}};export{a as default};
//# sourceMappingURL=get-single.mjs.map