We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c3c1354 commit d141493Copy full SHA for d141493
apps/web/lib/api/customers/get-customer-or-throw.ts
@@ -9,7 +9,16 @@ export const getCustomerOrThrow = async ({
9
workspaceId: string;
10
}) => {
11
const customer = await prisma.customer.findUnique({
12
- where: { id },
+ where: {
13
+ ...(id.startsWith("ext_")
14
+ ? {
15
+ projectId_externalId: {
16
+ projectId: workspaceId,
17
+ externalId: id.replace("ext_", ""),
18
+ },
19
+ }
20
+ : { id }),
21
22
});
23
24
if (!customer || customer.projectId !== workspaceId) {
0 commit comments