Skip to content

I can't write the proper code for mutation to update the table #1445

Closed Answered by saifrahmn
saifrahmn asked this question in Q&A
Discussion options

You must be logged in to vote

Someone from reddit helped me, saying

em.find returns an array and not a single post. You should try something like findOne / findByPk

I fixed it my changing my const post variable
const post= await em.findOne(Post, { id });
So the answer is solved

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@carlocorradini
Comment options

@saifrahmn
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by saifrahmn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants