Skip to content

Commit 1a83e62

Browse files
committed
Refactor customer details and improve modal functionality
- Removed unused imports and cleaned up the customer details column for better readability. - Enhanced the EditCustomerModal component by ensuring proper state management and form handling. - Updated the customer schema to enforce required fields and improved error messaging. - Adjusted the layout and styling for better user experience in customer-related components.
1 parent 9d4c0f4 commit 1a83e62

File tree

5 files changed

+262
-270
lines changed

5 files changed

+262
-270
lines changed

apps/web/app/(ee)/partners.dub.co/(dashboard)/programs/[programSlug]/(enrolled)/customers/[customerId]/page-client.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { CUSTOMER_PAGE_EVENTS_LIMIT } from "@/lib/constants/misc";
44
import usePartnerCustomer from "@/lib/swr/use-partner-customer";
55
import useProgramEnrollment from "@/lib/swr/use-program-enrollment";
66
import { PartnerEarningsResponse } from "@/lib/types";
7-
import { CustomerEnriched } from "@/lib/types";
87
import { CustomerActivityList } from "@/ui/customers/customer-activity-list";
98
import { CustomerDetailsColumn } from "@/ui/customers/customer-details-column";
109
import { CustomerSalesTable } from "@/ui/customers/customer-sales-table";
@@ -82,11 +81,11 @@ export function ProgramCustomerPageClient() {
8281
<CustomerDetailsColumn
8382
customer={
8483
customer && customer.id
85-
? ({
84+
? {
8685
...customer,
8786
name: customer.name || "",
8887
externalId: "",
89-
})
88+
}
9089
: undefined
9190
}
9291
customerActivity={customer?.activity}

apps/web/app/app.dub.co/(deeplink)/deeplink/[domain]/[key]/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { encodeKeyIfCaseSensitive } from "@/lib/api/links/case-sensitivity";
12
import { deepViewDataSchema } from "@/lib/zod/schemas/deep-links";
23
import { prisma } from "@dub/prisma";
34
import { Grid, Wordmark } from "@dub/ui";
@@ -9,7 +10,6 @@ import { redirect } from "next/navigation";
910
import { DeepLinkActionButtons } from "./action-buttons";
1011
import { BrandLogoBadge } from "./brand-logo-badge";
1112
import { getLanguage, getTranslations } from "./translations";
12-
import { encodeKeyIfCaseSensitive } from "@/lib/api/links/case-sensitivity";
1313

1414
export default async function DeepLinkPreviewPage(props: {
1515
params: Promise<{ domain: string; key: string }>;
@@ -27,7 +27,7 @@ export default async function DeepLinkPreviewPage(props: {
2727
// Encode the key for case-sensitive domains before querying
2828
const encodedKey = encodeKeyIfCaseSensitive({
2929
domain,
30-
key
30+
key,
3131
});
3232

3333
const link = await prisma.link.findUnique({

apps/web/lib/zod/schemas/customers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export const createCustomerBodySchema = z.object({
9393
"The customer's avatar URL. If not provided, a random avatar will be generated.",
9494
),
9595
externalId: z
96-
.string()
96+
.string("External ID is required")
9797
.describe(
9898
"The customer's unique identifier your database. This is useful for associating subsequent conversion events from Dub's API to your internal systems.",
9999
),

0 commit comments

Comments
 (0)