Sexy
Sexy13mo ago

Validation problem

hello guys, i turned over anything, but i could find, how to make the validation of id right, am i missing something?
No description
No description
No description
18 Replies
lee
lee13mo ago
Can you share the code that calls handleArrived? It looks like the mutation expects it to be called with a string value but it's being called with an object {id: "stringvalue"}
Spiced
Spiced13mo ago
Shouldn't the id args just be v.string()?
Sexy
SexyOP13mo ago
<AlertDialogAction onClick={() => handleArrived(id)}>
lee
lee13mo ago
Where is that id coming from? You could console.log it to see what it is Probably console.log(JSON.stringify(id)) because i'm pretty sure it's an object, not a string
Sexy
SexyOP13mo ago
<Accordion type="multiple"> <AccordionItem key={message._id} value={message._id}> <AccordionTrigger> {message.isArrived ? "Да" : "Не"} </AccordionTrigger> <AccordionContent> <AlertDialogDemo id={message._id} /> </AccordionContent> </AccordionItem> </Accordion> it's not object in dashboard if i use the function with the following id, its working
lee
lee13mo ago
When you console.log, what does it show?
Sexy
SexyOP13mo ago
No description
lee
lee13mo ago
Yeah that's an object
Sexy
SexyOP13mo ago
sorry
lee
lee13mo ago
At a guess, you're doing function AlertDialogDemo(id) instead of function AlertDialogDemo({id})
Sexy
SexyOP13mo ago
wait
Sexy
SexyOP13mo ago
No description
Sexy
SexyOP13mo ago
im not calling it AlertDialogDemo(id) <AlertDialogDemo id={message._id} />
lee
lee13mo ago
Can you share the code where AlertDialogDemo is defined
Sexy
SexyOP13mo ago
No description
lee
lee13mo ago
Line 18
At a guess, you're doing function AlertDialogDemo(id) instead of function AlertDialogDemo({id})
Line 48 was good, maybe change it back?
Sexy
SexyOP13mo ago
thank you Lee 🍺

Did you find this page helpful?