From ed1599aaf710492209dce3d54f7f8963cf1cfc8c Mon Sep 17 00:00:00 2001 From: Namekuji Date: Tue, 5 Sep 2023 20:32:12 -0400 Subject: [PATCH] fix: keep limit if using postgres --- packages/backend/src/server/api/endpoints/antennas/create.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/backend/src/server/api/endpoints/antennas/create.ts b/packages/backend/src/server/api/endpoints/antennas/create.ts index cba1ec04d7..54e811c7c1 100644 --- a/packages/backend/src/server/api/endpoints/antennas/create.ts +++ b/packages/backend/src/server/api/endpoints/antennas/create.ts @@ -3,6 +3,7 @@ import { genId } from "@/misc/gen-id.js"; import { Antennas, UserLists, UserGroupJoinings } from "@/models/index.js"; import { ApiError } from "../../error.js"; import { publishInternalEvent } from "@/services/stream.js"; +import { scyllaClient } from "@/db/scylla.js"; export const meta = { tags: ["antennas"], @@ -112,7 +113,8 @@ export default define(meta, paramDef, async (ps, user) => { const antennas = await Antennas.findBy({ userId: user.id, }); - if (antennas.length > 100 && !user.isAdmin) { + const antennaLimit = scyllaClient ? 100 : 5; + if (antennas.length > antennaLimit && !user.isAdmin) { throw new ApiError(meta.errors.tooManyAntennas); }