f4f48712c5
refs https://github.com/TryGhost/Team/issues/597 - When the library is used on a client without a DB connection (e.g. frontend client running in a browser) the library needs to expose a way to override count queries. - The way these can be used is giving a count based on a HTTP request or some other data provider - Example use with max limit like "staff" would be loading the limit servcie if following way: ``` const limitService = new LimitService(); let limits = { staff: { max: 2, currentCountQuery: () => 5 } }; limitService.loadLimits({limits, errors}); await limitService.checkIsOverLimit('staff') ``` |
||
---|---|---|
ghost |