Add labels to the integration api

This commit is contained in:
Owen
2026-10-12 16:21:12 -04:00
parent 9afcd68d68
commit e461b231d5
8 changed files with 246 additions and 1 deletions
+27
View File
@@ -1,6 +1,7 @@
import { db, labels } from "@server/db";
import response from "@server/lib/response";
import logger from "@server/logger";
import { OpenAPITags, registry } from "@server/openApi";
import HttpCode from "@server/types/HttpCode";
import { and, eq } from "drizzle-orm";
import { NextFunction, Request, Response } from "express";
@@ -13,6 +14,32 @@ const paramsSchema = z.strictObject({
labelId: z.string().transform(Number).pipe(z.int().positive())
});
registry.registerPath({
method: "delete",
path: "/org/{orgId}/label/{labelId}",
description: "Delete a label.",
tags: [OpenAPITags.Label],
request: {
params: paramsSchema
},
responses: {
200: {
description: "Successful response",
content: {
"application/json": {
schema: z.object({
data: z.record(z.string(), z.any()).nullable(),
success: z.boolean(),
error: z.boolean(),
message: z.string(),
status: z.number()
})
}
}
}
}
});
export async function deleteOrgLabel(
req: Request,
res: Response,