UNPKG

@payloadcms/plugin-multi-tenant

Version:
19 lines (18 loc) 594 B
export const findTenantOptions = async ({ limit, payload, tenantsCollectionSlug, useAsTitle, user })=>{ const isOrderable = payload.collections[tenantsCollectionSlug]?.config?.orderable || false; return payload.find({ collection: tenantsCollectionSlug, depth: 0, limit, overrideAccess: false, select: { [useAsTitle]: true, ...isOrderable ? { _order: true } : {} }, sort: isOrderable ? '_order' : useAsTitle, user }); }; //# sourceMappingURL=findTenantOptions.js.map