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.

Update workspaceId description in link-related APIs

Kiran Kd42c92737c08
diff --git a/apps/web/lib/openapi/links/delete-link.ts b/apps/web/lib/openapi/links/delete-link.ts
index 16a1c89280..2d117a1e72 100644
--- a/apps/web/lib/openapi/links/delete-link.ts
+++ b/apps/web/lib/openapi/links/delete-link.ts
@@ -12,7 +12,7 @@ export const deleteLink: ZodOpenApiOperationObject = {
query: z.object({
workspaceId: z
.string()
- .describe("The ID of the workspace that the link belongs to."),
+ .describe("The ID of the workspace the link belongs to."),
}),
path: z.object({
linkId: z.string().openapi({
diff --git a/apps/web/lib/openapi/links/edit-link.ts b/apps/web/lib/openapi/links/edit-link.ts
index 1c61493819..df476457da 100644
--- a/apps/web/lib/openapi/links/edit-link.ts
+++ b/apps/web/lib/openapi/links/edit-link.ts
@@ -12,7 +12,7 @@ export const editLink: ZodOpenApiOperationObject = {
query: z.object({
workspaceId: z
.string()
- .describe("The ID of the workspace that the link belongs to."),
+ .describe("The ID of the workspace the link belongs to."),
}),
path: z.object({
linkId: z.string().openapi({
diff --git a/apps/web/lib/openapi/links/get-link-info.ts b/apps/web/lib/openapi/links/get-link-info.ts
index 99a89605d8..63c5b1bce6 100644
--- a/apps/web/lib/openapi/links/get-link-info.ts
+++ b/apps/web/lib/openapi/links/get-link-info.ts
@@ -1,7 +1,7 @@
import { ZodOpenApiOperationObject } from "zod-openapi";
import { openApiErrorResponses } from "@/lib/openapi/responses";
-import { workspaceIdSchema } from "@/lib/zod";
+import z from "@/lib/zod";
import { getLinkInfoQuerySchema, LinkSchema } from "@/lib/zod/schemas/links";
export const getLinkInfo: ZodOpenApiOperationObject = {
@@ -9,7 +9,13 @@ export const getLinkInfo: ZodOpenApiOperationObject = {
summary: "Retrieve a link",
description: "Retrieve the info for a link from their domain and key.",
requestParams: {
- query: workspaceIdSchema.merge(getLinkInfoQuerySchema),
+ query: z
+ .object({
+ workspaceId: z
+ .string()
+ .describe("The ID of the workspace the link belongs to."),
+ })
+ .merge(getLinkInfoQuerySchema),
},
responses: {
"200": {
diff --git a/apps/web/lib/openapi/links/get-links-count.ts b/apps/web/lib/openapi/links/get-links-count.ts
index 057f98734c..242b1777ce 100644
--- a/apps/web/lib/openapi/links/get-links-count.ts
+++ b/apps/web/lib/openapi/links/get-links-count.ts
@@ -1,5 +1,5 @@
import { openApiErrorResponses } from "@/lib/openapi/responses";
-import z, { workspaceIdSchema } from "@/lib/zod";
+import z from "@/lib/zod";
import { getLinksCountQuerySchema, LinkSchema } from "@/lib/zod/schemas/links";
import { ZodOpenApiOperationObject } from "zod-openapi";
@@ -9,7 +9,13 @@ export const getLinksCount: ZodOpenApiOperationObject = {
description:
"Retrieve the number of links for the authenticated workspace. The provided query parameters allow filtering the returned links.",
requestParams: {
- query: workspaceIdSchema.merge(getLinksCountQuerySchema),
+ query: z
+ .object({
+ workspaceId: z
+ .string()
+ .describe("The ID of the workspace the link belongs to."),
+ })
+ .merge(getLinksCountQuerySchema),
},
responses: {
"200": {
diff --git a/apps/web/lib/openapi/links/get-links.ts b/apps/web/lib/openapi/links/get-links.ts
index e1fed6e06b..5a1ed1c448 100644
--- a/apps/web/lib/openapi/links/get-links.ts
+++ b/apps/web/lib/openapi/links/get-links.ts
@@ -1,5 +1,5 @@
import { openApiErrorResponses } from "@/lib/openapi/responses";
-import z, { workspaceIdSchema } from "@/lib/zod";
+import z from "@/lib/zod";
import { getLinksQuerySchema, LinkSchema } from "@/lib/zod/schemas/links";
import { ZodOpenApiOperationObject } from "zod-openapi";
@@ -9,7 +9,13 @@ export const getLinks: ZodOpenApiOperationObject = {
description:
"Retrieve a list of links for the authenticated workspace. The list will be paginated and the provided query parameters allow filtering the returned links.",
requestParams: {
- query: workspaceIdSchema.merge(getLinksQuerySchema),
+ query: z
+ .object({
+ workspaceId: z
+ .string()
+ .describe("The ID of the workspace the link belongs to."),
+ })
+ .merge(getLinksQuerySchema),
},
responses: {
"200": {
diff --git a/apps/web/lib/zod/index.ts b/apps/web/lib/zod/index.ts
index 66105b0c43..e1c59a9f66 100644
--- a/apps/web/lib/zod/index.ts
+++ b/apps/web/lib/zod/index.ts
@@ -18,4 +18,4 @@ export const workspaceIdSchema = z.object({
.string()
.min(1, "Workspace ID is required.")
.describe("The ID of the workspace the link belongs to."),
-});
+});
\ No newline at end of file