Revert "feat(api): better errors and documentation"

This commit is contained in:
Maidul Islam
2024-09-27 17:25:11 -04:00
committed by GitHub
parent d430293c66
commit 4090c894fc
107 changed files with 854 additions and 979 deletions
+2 -2
View File
@@ -3,7 +3,7 @@ import { validate as uuidValidate } from "uuid";
import { TDbClient } from "@app/db";
import { SecretsSchema, SecretType, TableName, TSecrets, TSecretsUpdate } from "@app/db/schemas";
import { BadRequestError, DatabaseError, NotFoundError } from "@app/lib/errors";
import { BadRequestError, DatabaseError } from "@app/lib/errors";
import { ormify, selectAllTableCols, sqlNestRelationships } from "@app/lib/knex";
export type TSecretDALFactory = ReturnType<typeof secretDALFactory>;
@@ -55,7 +55,7 @@ export const secretDALFactory = (db: TDbClient) => {
);
if (existingSecrets.length !== data.length) {
throw new NotFoundError({ message: "Some of the secrets do not exist" });
throw new BadRequestError({ message: "Some of the secrets do not exist" });
}
if (data.length === 0) return [];