Anybody having issues with supabase in regards to ...
# javascript
b
Anybody having issues with supabase in regards to 'PATCH' request and headers? When I make a update it makes the change in the database but doesnt display the data on the client
g
You are asking about PATCH, but in the js section. JS client returns data unless you specify option "returning:minimum". If doing a direct http request with PATCH you may have to specify a header "Prefer: return=representation" but I don't know what the default is...
b
// Update post if (req.method === 'PATCH') { try { const post = await prisma.post.update({ where: { id }, data: req.body, }); res.status(200).json(post); } catch (e) { res.status(500).json({ message: 'Something went wrong' }); }
This is what I have rn
g
OK, I'm going to bow out as you seem to be using Prisma and I know little about that and how your call relates to https://supabase.com/docs/reference/javascript/update If you can see the actual call going to supabase it would be interesting to see what the Prefer header is. I encourage you to start a new question mentioning Prisma, if that is appropriate, as once a thread gets going you lose focus.
2 Views