Skip to content

Commit 6587f9d

Browse files
authored
Fix vercel build (#8)
1 parent 2684b00 commit 6587f9d

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

app/api/contact-form/route.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { TENANT_EXTERNAL_ID } from "@/app/page";
21
import { plainClient } from "@/lib/plainClient";
32
import { inspect } from "util";
43

@@ -10,6 +9,7 @@ export type RequestBody = {
109
// When implementing this for real, take these values from user auth (e.g validate auth token and take values from claims)
1110
const name = "Bob Smith";
1211
const email = "bob.smith@example.com";
12+
const tenantExternalId = "abcd1234";
1313

1414
export async function POST(request: Request) {
1515
// In production validation of the request body might be necessary.
@@ -25,7 +25,7 @@ export async function POST(request: Request) {
2525
email: email,
2626
isVerified: true,
2727
},
28-
tenantIdentifiers: [{ externalId: TENANT_EXTERNAL_ID }],
28+
tenantIdentifiers: [{ externalId: tenantExternalId }],
2929
},
3030
onUpdate: {},
3131
});
@@ -48,7 +48,7 @@ export async function POST(request: Request) {
4848
customerId: upsertCustomerRes.data.customer.id,
4949
},
5050
title: body.title,
51-
tenantIdentifier: { externalId: TENANT_EXTERNAL_ID },
51+
tenantIdentifier: { externalId: tenantExternalId },
5252
components: [
5353
{
5454
componentText: {

app/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { ThreadStatus } from "@team-plain/typescript-sdk";
88
export const fetchCache = "force-no-store";
99

1010
// When adapting this example get the tenant id as part of auth or fetch it afterwards
11-
export const TENANT_EXTERNAL_ID = "abcd1234";
11+
const tenantExternalId = "abcd1234";
1212

1313
export default async function Home({
1414
searchParams,
@@ -20,7 +20,7 @@ export default async function Home({
2020
// If you want to only allow customers to view threads they have raised then you can filter by customerIds instead.
2121
// Note that if you provide multiple filters they are combined with AND rather than OR.
2222
// customerIds: ["c_01J28ZQKJX9CVRXVHBMAXNSV5G"],
23-
tenantIdentifiers: [{ externalId: TENANT_EXTERNAL_ID }],
23+
tenantIdentifiers: [{ externalId: tenantExternalId }],
2424
statuses: [ThreadStatus.Todo, ThreadStatus.Snoozed],
2525
},
2626
after: searchParams.after as string | undefined,

0 commit comments

Comments
 (0)