UNPKG

@lucidcms/core

Version:

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

2 lines 585 B
import{copy as e}from"../../../libs/i18n/copy.mjs";import t from"../../../libs/repositories/roles.mjs";const n=async(n,r)=>{if(r.roleIds.length===0)return{error:void 0,data:void 0};let i=await new t(n.db.client,n.config.db).selectMultipleIdsByIds({ids:r.roleIds,tenantKey:r.tenantKey,validation:{enabled:!0}});return i.error?i:i.data.length===r.roleIds.length?{error:void 0,data:void 0}:{error:{type:`basic`,status:400,errors:{roleIds:{code:`invalid`,message:e(`server:core.roles.not.found.message`)}}},data:void 0}};export{n as default}; //# sourceMappingURL=check-roles-exist.mjs.map