File tree Expand file tree Collapse file tree 1 file changed +14
-6
lines changed
Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -11,11 +11,19 @@ import { generateImpersonationToken } from "~/services/impersonation.server";
1111// Schema for the request body from Plain
1212const PlainCustomerCardRequestSchema = z . object ( {
1313 cardKeys : z . array ( z . string ( ) ) ,
14- customer : z . object ( {
15- id : z . string ( ) ,
16- email : z . string ( ) . optional ( ) ,
17- externalId : z . string ( ) . optional ( ) ,
18- } ) ,
14+ customer : z
15+ . object ( {
16+ id : z . string ( ) ,
17+ email : z . string ( ) . optional ( ) ,
18+ externalId : z . string ( ) . optional ( ) ,
19+ } )
20+ . refine (
21+ ( data ) => data . email || data . externalId ,
22+ {
23+ message : "Either customer.email or customer.externalId must be provided" ,
24+ path : [ "customer" ] ,
25+ }
26+ ) ,
1927 thread : z
2028 . object ( {
2129 id : z . string ( ) ,
@@ -320,7 +328,7 @@ export async function action({ request }: ActionFunctionArgs) {
320328 ] ,
321329 asideContent : [
322330 uiComponent . text ( {
323- text : `${ projectCount } project${ projectCount !== 1 ? "s" : "" } ` ,
331+ text : `${ projectCount } recent project${ projectCount !== 1 ? "s" : "" } ` ,
324332 size : "S" ,
325333 color : "MUTED" ,
326334 } ) ,
You can’t perform that action at this time.
0 commit comments