Sexy
Sexy2y 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
lee2y 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
Spiced2y ago
Shouldn't the id args just be v.string()?
Sexy
SexyOP2y ago
<AlertDialogAction onClick={() => handleArrived(id)}>
lee
lee2y 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
SexyOP2y 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
lee2y ago
When you console.log, what does it show?
Sexy
SexyOP2y ago
No description
lee
lee2y ago
Yeah that's an object
Sexy
SexyOP2y ago
sorry
lee
lee2y ago
At a guess, you're doing function AlertDialogDemo(id) instead of function AlertDialogDemo({id})
Sexy
SexyOP2y ago
wait
Sexy
SexyOP2y ago
No description
Sexy
SexyOP2y ago
im not calling it AlertDialogDemo(id) <AlertDialogDemo id={message._id} />
lee
lee2y ago
Can you share the code where AlertDialogDemo is defined
Sexy
SexyOP2y ago
No description
lee
lee2y 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
SexyOP2y ago
thank you Lee 🍺

Did you find this page helpful?