Update secret-tag-router.ts

This commit is contained in:
Daniel Hougaard
2024-03-25 21:41:12 +01:00
parent 2240277243
commit b606990dfb
@@ -1,6 +1,7 @@
import { z } from "zod"; import { z } from "zod";
import { SecretTagsSchema } from "@app/db/schemas"; import { SecretTagsSchema } from "@app/db/schemas";
import { SECRET_TAGS } from "@app/lib/api-docs";
import { verifyAuth } from "@app/server/plugins/auth/verify-auth"; import { verifyAuth } from "@app/server/plugins/auth/verify-auth";
import { AuthMode } from "@app/services/auth/auth-type"; import { AuthMode } from "@app/services/auth/auth-type";
@@ -10,7 +11,7 @@ export const registerSecretTagRouter = async (server: FastifyZodProvider) => {
method: "GET", method: "GET",
schema: { schema: {
params: z.object({ params: z.object({
projectId: z.string().trim() projectId: z.string().trim().describe(SECRET_TAGS.LIST.projectId)
}), }),
response: { response: {
200: z.object({ 200: z.object({
@@ -36,12 +37,12 @@ export const registerSecretTagRouter = async (server: FastifyZodProvider) => {
method: "POST", method: "POST",
schema: { schema: {
params: z.object({ params: z.object({
projectId: z.string().trim() projectId: z.string().trim().describe(SECRET_TAGS.CREATE.projectId)
}), }),
body: z.object({ body: z.object({
name: z.string().trim(), name: z.string().trim().describe(SECRET_TAGS.CREATE.name),
slug: z.string().trim(), slug: z.string().trim().describe(SECRET_TAGS.CREATE.slug),
color: z.string() color: z.string().trim().describe(SECRET_TAGS.CREATE.color)
}), }),
response: { response: {
200: z.object({ 200: z.object({
@@ -68,8 +69,8 @@ export const registerSecretTagRouter = async (server: FastifyZodProvider) => {
method: "DELETE", method: "DELETE",
schema: { schema: {
params: z.object({ params: z.object({
projectId: z.string().trim(), projectId: z.string().trim().describe(SECRET_TAGS.DELETE.projectId),
tagId: z.string().trim() tagId: z.string().trim().describe(SECRET_TAGS.DELETE.tagId)
}), }),
response: { response: {
200: z.object({ 200: z.object({