Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

add DELETE /tags/[id] to OpenAPI

Steven Tey1837ac12fd1e
diff --git a/apps/web/app/api/tags/[id]/route.ts b/apps/web/app/api/tags/[id]/route.ts
index 82de6659ca..c86fa3265d 100644
--- a/apps/web/app/api/tags/[id]/route.ts
+++ b/apps/web/app/api/tags/[id]/route.ts
@@ -55,7 +55,7 @@ export const PATCH = withWorkspace(
export const PUT = PATCH;
-// DELETE /api/workspaces/[idOrSlug]/tags/[id] – delete a tag for a workspace
+// DELETE /api/tags/[id] – delete a tag for a workspace
export const DELETE = withWorkspace(
async ({ params, workspace }) => {
const { id } = params;
diff --git a/apps/web/lib/openapi/links/delete-link.ts b/apps/web/lib/openapi/links/delete-link.ts
index 033279ee4a..49b1703f58 100644
--- a/apps/web/lib/openapi/links/delete-link.ts
+++ b/apps/web/lib/openapi/links/delete-link.ts
@@ -18,7 +18,7 @@ export const deleteLink: ZodOpenApiOperationObject = {
},
responses: {
"200": {
- description: "The deleted link",
+ description: "The deleted link ID.",
content: {
"application/json": {
schema: z.object({
diff --git a/apps/web/lib/openapi/tags/delete-tag.ts b/apps/web/lib/openapi/tags/delete-tag.ts
new file mode 100644
index 0000000000..b1f603adf2
--- /dev/null
+++ b/apps/web/lib/openapi/tags/delete-tag.ts
@@ -0,0 +1,32 @@
+import { openApiErrorResponses } from "@/lib/openapi/responses";
+import z from "@/lib/zod";
+import { ZodOpenApiOperationObject } from "zod-openapi";
+
+export const deleteTag: ZodOpenApiOperationObject = {
+ operationId: "deleteTag",
+ "x-speakeasy-name-override": "delete",
+ "x-speakeasy-max-method-params": 1,
+ summary: "Delete a tag",
+ description:
+ "Delete a tag from the workspace. All existing links will still work, but they will no longer be associated with this tag.",
+ requestParams: {
+ path: z.object({
+ id: z.string().describe("The ID of the tag to delete."),
+ }),
+ },
+ responses: {
+ "200": {
+ description: "The deleted tag ID.",
+ content: {
+ "application/json": {
+ schema: z.object({
+ id: z.string().describe("The ID of the deleted tag."),
+ }),
+ },
+ },
+ },
+ ...openApiErrorResponses,
+ },
+ tags: ["Tags"],
+ security: [{ token: [] }],
+};
diff --git a/apps/web/lib/openapi/tags/index.ts b/apps/web/lib/openapi/tags/index.ts
index be1c4ce9f6..6d323be6e1 100644
--- a/apps/web/lib/openapi/tags/index.ts
+++ b/apps/web/lib/openapi/tags/index.ts
@@ -1,6 +1,7 @@
import { ZodOpenApiPathsObject } from "zod-openapi";
import { createTag } from "./create-tag";
+import { deleteTag } from "./delete-tag";
import { getTags } from "./get-tags";
import { updateTag } from "./update-tag";
@@ -11,5 +12,6 @@ export const tagsPaths: ZodOpenApiPathsObject = {
},
"/tags/{id}": {
patch: updateTag,
+ delete: deleteTag,
},
};