joas8211 / payload-tenancy

Multi-tenancy plugin for Payload CMS
MIT License
150 stars 11 forks source link

how to set limit parameter to find more than 10 child tenants? #33

Open kouohhashi opened 1 year ago

kouohhashi commented 1 year ago

Hi,

The search limit in PayloadCMS is set to 10 by default. Because of this, if there are more than 10 child tenants, the list only shows the first 10. Can I change the settings to increase the limit above 10?

kouohhashi commented 12 months ago

I found a work-around. Adding for example, limit: 20 in node_modules/payload-tenancy/dist/utils/getAuthorizedTenants.js works okay.

return [4 /*yield*/, payload.find({
  collection: options.tenantCollection,
  where: { parent: { equals: tenantId } },
  limit: 20, // <-- here
})];