File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 1- import { TENANT_EXTERNAL_ID } from "@/app/page" ;
21import { plainClient } from "@/lib/plainClient" ;
32import { 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)
1110const name = "Bob Smith" ;
1211const email = "bob.smith@example.com" ;
12+ const tenantExternalId = "abcd1234" ;
1313
1414export 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 : {
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ import { ThreadStatus } from "@team-plain/typescript-sdk";
88export 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
1313export 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 ,
You can’t perform that action at this time.
0 commit comments