fix: limits is not defined
This commit is contained in:
@@ -85,13 +85,12 @@ export const monitors = new Elysia({ prefix: "/monitors" })
|
|||||||
|
|
||||||
// Update monitor
|
// Update monitor
|
||||||
.patch("/:id", async ({ accountId, plan, params, body, set }) => {
|
.patch("/:id", async ({ accountId, plan, params, body, set }) => {
|
||||||
|
const limits = getPlanLimits(plan);
|
||||||
|
|
||||||
// Enforce minimum interval for plan
|
// Enforce minimum interval for plan
|
||||||
if (body.interval_s != null) {
|
if (body.interval_s != null && body.interval_s < limits.minIntervalS) {
|
||||||
const limits = getPlanLimits(plan);
|
set.status = 400;
|
||||||
if (body.interval_s < limits.minIntervalS) {
|
return { error: `Minimum interval for ${plan} plan is ${limits.minIntervalS}s` };
|
||||||
set.status = 400;
|
|
||||||
return { error: `Minimum interval for ${plan} plan is ${limits.minIntervalS}s` };
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Enforce region limit for plan
|
// Enforce region limit for plan
|
||||||
|
|||||||
Reference in New Issue
Block a user