misc: used destructuring

This commit is contained in:
Sheen Capadngan
2024-08-06 02:05:13 +08:00
parent 0f23b7e1d3
commit 1070954bdd
@@ -15,10 +15,9 @@ export const injectRateLimits = fp(async (server) => {
return; return;
} }
const plan = await server.services.license.getPlan(req.auth.orgId); const { rateLimits, customRateLimits } = await server.services.license.getPlan(req.auth.orgId);
const { rateLimits } = plan;
if (plan.customRateLimits && !appCfg.isCloud) { if (customRateLimits && !appCfg.isCloud) {
// we do this because for self-hosted/dedicated instances, we want custom rate limits to be based on admin configuration // we do this because for self-hosted/dedicated instances, we want custom rate limits to be based on admin configuration
// note that the syncing of custom rate limit happens on the instanceRateLimiterConfig object // note that the syncing of custom rate limit happens on the instanceRateLimiterConfig object
req.rateLimits = instanceRateLimiterConfig; req.rateLimits = instanceRateLimiterConfig;