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.

code improvements

Pedro Ladeirab8c95be90c0c
diff --git a/apps/web/lib/zod/schemas/partner-profile.ts b/apps/web/lib/zod/schemas/partner-profile.ts
index dc70a50ee7..5efc3512c9 100644
--- a/apps/web/lib/zod/schemas/partner-profile.ts
+++ b/apps/web/lib/zod/schemas/partner-profile.ts
@@ -317,9 +317,6 @@ export const PARTNER_CUSTOMER_EXPORT_COLUMNS = [
},
] as const;
-type PartnerCustomerExportColumnId =
- (typeof PARTNER_CUSTOMER_EXPORT_COLUMNS)[number]["id"];
-
export const PARTNER_CUSTOMER_EXPORT_DEFAULT_COLUMNS =
PARTNER_CUSTOMER_EXPORT_COLUMNS.filter((column) => column.default).map(
(column) => column.id,
@@ -343,12 +340,13 @@ export const partnerCustomersExportQuerySchema = getPartnerCustomersQuerySchema
)
.refine(
(columns) => {
- const validColumnIds = PARTNER_CUSTOMER_EXPORT_COLUMNS.map(
- (col) => col.id,
+ const validColumnIds = new Set<string>(
+ PARTNER_CUSTOMER_EXPORT_COLUMNS.map((col) => col.id),
);
- return columns.every((column: PartnerCustomerExportColumnId) =>
- validColumnIds.includes(column),
+ return (
+ columns.length > 0 &&
+ columns.every((column) => validColumnIds.has(column))
);
},
{