fix: limits is not defined
This commit is contained in:
parent
db90c74560
commit
2561558c50
|
|
@ -85,14 +85,13 @@ 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 }) => {
|
||||||
// Enforce minimum interval for plan
|
|
||||||
if (body.interval_s != null) {
|
|
||||||
const limits = getPlanLimits(plan);
|
const limits = getPlanLimits(plan);
|
||||||
if (body.interval_s < limits.minIntervalS) {
|
|
||||||
|
// Enforce minimum interval for plan
|
||||||
|
if (body.interval_s != null && body.interval_s < limits.minIntervalS) {
|
||||||
set.status = 400;
|
set.status = 400;
|
||||||
return { error: `Minimum interval for ${plan} plan is ${limits.minIntervalS}s` };
|
return { error: `Minimum interval for ${plan} plan is ${limits.minIntervalS}s` };
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Enforce region limit for plan
|
// Enforce region limit for plan
|
||||||
if (body.regions && body.regions.length > limits.maxRegions) {
|
if (body.regions && body.regions.length > limits.maxRegions) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue