UNPKG

@lucidcms/core

Version:

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

2 lines 732 B
import{copy as e}from"../../libs/i18n/copy.mjs";import t from"../../utils/helpers/get-base-url.mjs";import n from"../../libs/repositories/media.mjs";import r from"../../libs/formatters/media.mjs";const i=async(i,a)=>{let o=await new n(i.db.client,i.config.db).selectSingleById({id:a.id,tenantKey:i.request.tenantKey,validation:{enabled:!0,defaultError:{message:e(`server:core.media.not.found.message`),status:404}}});return o.error?o:o.data.tenant_key&&i.request.tenantKey&&o.data.tenant_key!==i.request.tenantKey?{error:{type:`basic`,message:e(`server:core.media.not.found.message`),status:404},data:void 0}:{error:void 0,data:r.formatSingle({media:o.data,host:t(i)})}};export{i as default}; //# sourceMappingURL=get-single.mjs.map