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
@@ -6,7 +6,7 @@ import picomatch from "picomatch";
import { SecretKeyEncoding, TWebhooks } from "@app/db/schemas";
import { request } from "@app/lib/config/request";
import { infisicalSymmetricDecrypt } from "@app/lib/crypto/encryption";
import { NotFoundError } from "@app/lib/errors";
import { BadRequestError } from "@app/lib/errors";
import { logger } from "@app/lib/logger";
import { TProjectDALFactory } from "../project/project-dal";
@@ -172,7 +172,7 @@ export const fnTriggerWebhook = async ({
await webhookDAL.transaction(async (tx) => {
const env = await projectEnvDAL.findOne({ projectId, slug: environment }, tx);
if (!env) throw new NotFoundError({ message: "Environment not found" });
if (!env) throw new BadRequestError({ message: "Env not found" });
if (successWebhooks.length) {
await webhookDAL.update(
{ envId: env.id, $in: { id: successWebhooks } },