From ba2609be28bdb8175f302d7d82b7443a3d9d0070 Mon Sep 17 00:00:00 2001 From: ProgrammerIn-wonderland <3838shah@gmail.com> Date: Fri, 5 Sep 2025 20:14:25 -0400 Subject: [PATCH] fix: APIErrors in entri service --- src/backend/src/services/EntriService.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/backend/src/services/EntriService.js b/src/backend/src/services/EntriService.js index 7cbdaae36..1cbb415b4 100644 --- a/src/backend/src/services/EntriService.js +++ b/src/backend/src/services/EntriService.js @@ -112,7 +112,7 @@ class EntriService extends BaseService { }); if (exists) { - throw new APIError("already_in_use", null, {what: "domain", value: domain}); + throw new APIError(409, "already_in_use", null, {what: "domain", value: domain}); } @@ -182,14 +182,14 @@ class EntriService extends BaseService { }, async deleteMapping({domain}) { if (domain.startsWith("in-progress")) - throw new APIError('field_invalid', null, {key: "domain", expected: 'valid domain'}); + throw new APIError(400, 'field_invalid', null, {key: "domain", expected: 'valid domain'}); /** @type {import("../om/entitystorage/SubdomainES")} */ const es_subdomain = this.services.get('es:subdomain'); const row = (await es_subdomain.select({ predicate: new Eq({ key: "domain", value: domain }) }))[0] || (await es_subdomain.select({ predicate: new Eq({ key: "domain", value: "in-progress:" + domain }) }))[0]; if (!row) { - throw new APIError('forbidden', null, {}); + throw new APIError(403, 'forbidden', null, {}); } let inProgress = false;