Validation problem
hello guys, i turned over anything, but i could find, how to make the validation of id right, am i missing something?



18 Replies
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"}
Shouldn't the id args just be v.string()?
<AlertDialogAction onClick={() => handleArrived(id)}>
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<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
When you console.log, what does it show?

Yeah that's an object
sorry
At a guess, you're doing
function AlertDialogDemo(id)
instead of function AlertDialogDemo({id})
No worries, classic react issue https://react.dev/learn/passing-props-to-a-component#step-2-read-props-inside-the-child-component
Passing Props to a Component – React
The library for web and native user interfaces
wait

im not calling it AlertDialogDemo(id)
<AlertDialogDemo id={message._id} />
Can you share the code where
AlertDialogDemo
is defined
Line 18
At a guess, you're doingLine 48 was good, maybe change it back?function AlertDialogDemo(id)
instead offunction AlertDialogDemo({id})
thank you Lee
🍺