UNPKG

@lucidcms/core

Version:

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

2 lines 687 B
import e from"../../libs/repositories/locales.mjs";import t from"./helpers/get-retention-days.mjs";const n=async n=>{let r=new e(n.db.client,n.config.db),i=t(n.config.retention,`removedLocales`),a=await r.selectMultiple({select:[`code`],where:[{key:`is_deleted_at`,operator:`<`,value:i},{key:`is_deleted`,operator:`=`,value:n.config.db.getDefault(`boolean`,`true`)}],validation:{enabled:!0}});if(a.error)return a;if(a.data.length===0)return{error:void 0,data:void 0};let o=await n.queue.addBatch(n,{event:`locales:delete`,payloads:a.data.map(e=>({localeCode:e.code}))});return o.error?o:{error:void 0,data:void 0}};export{n as default}; //# sourceMappingURL=clear-expired-locales.mjs.map