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.

omit url

Steven Tey5c0d7caa6c01
diff --git a/apps/web/lib/api/links/bulk-update-links.ts b/apps/web/lib/api/links/bulk-update-links.ts
index 01a53fd488..8c5a27a60c 100644
--- a/apps/web/lib/api/links/bulk-update-links.ts
+++ b/apps/web/lib/api/links/bulk-update-links.ts
@@ -9,12 +9,14 @@ import { propagateBulkLinkChanges } from "./propagate-bulk-link-changes";
import { combineTagIds, transformLink } from "./utils";
export async function bulkUpdateLinks(
- params: z.infer<typeof bulkUpdateLinksBodySchema> & { workspaceId: string },
+ params: z.infer<typeof bulkUpdateLinksBodySchema> & {
+ workspaceId: string;
+ url?: string;
+ },
) {
- const { linkIds, data, workspaceId } = params;
+ const { linkIds, data, workspaceId, url } = params;
const {
- url,
title,
description,
image,
diff --git a/apps/web/lib/zod/schemas/links.ts b/apps/web/lib/zod/schemas/links.ts
index db9c73a72b..cd33834bc1 100644
--- a/apps/web/lib/zod/schemas/links.ts
+++ b/apps/web/lib/zod/schemas/links.ts
@@ -257,25 +257,14 @@ export const bulkUpdateLinksBodySchema = z.object({
.array(z.string())
.min(1, "No links updated – you must provide at least one link.")
.max(100, "You can only update up to 100 links at a time."),
- data: createLinkBodySchema
- .omit({
- id: true,
- domain: true,
- key: true,
- url: true,
- externalId: true,
- prefix: true,
- })
- .merge(
- z.object({
- url: parseUrlSchema
- .describe("The destination URL of the short link.")
- .openapi({
- example: "https://google/com",
- })
- .optional(),
- }),
- ),
+ data: createLinkBodySchema.omit({
+ id: true,
+ domain: true,
+ key: true,
+ url: true,
+ externalId: true,
+ prefix: true,
+ }),
});
export const LinkSchema = z