Turn your audience into a business. Publishing, memberships, subscriptions and newsletters.
Go to file
Naz f4f48712c5 Added custom count queries for "max" limits
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')
```
2021-04-06 16:45:46 +12:00
ghost Added custom count queries for "max" limits 2021-04-06 16:45:46 +12:00