UNPKG

@lucidcms/core

Version:

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

2 lines 964 B
import{copy as e}from"../../libs/i18n/copy.mjs";import t from"../../libs/repositories/options.mjs";const n=async n=>{try{let e=new t(n.db.client,n.config.db),r=await e.selectSingle({select:[`name`],where:[{key:`name`,operator:`=`,value:`media_storage_used`}]});if(r.error)return r;if(r.data===void 0){let t=await e.createSingle({data:{name:`media_storage_used`,value_int:0},returning:[`name`,`value_int`],validation:{enabled:!0}});if(t.error)return t}let i=await e.selectSingle({select:[`name`],where:[{key:`name`,operator:`=`,value:`system_alert_email`}]});if(i.error)return i;if(i.data===void 0){let t=await e.createSingle({data:{name:`system_alert_email`,value_text:null},returning:[`name`,`value_text`],validation:{enabled:!0}});if(t.error)return t}return{error:void 0,data:void 0}}catch{return{error:{type:`basic`,message:e(`server:core.options.error.occurred.saving.default`)},data:void 0}}};export{n as default}; //# sourceMappingURL=default-options.mjs.map