Make sure you have insert with returning set to mi...
# help
g
Make sure you have insert with returning set to minimum or the insert does a read. At least in JS.
f
I'm doing this, doesnt work on postam or js
Copy code
curl --location --request POST 'https://url.supabase.co/rest/v1/usuarios' \
--header 'apikey: abc' \
--header 'Content-Type: application/json' \
--header 'Prefer: return=representation' \
--data-raw '{ "dni": "111", "email": "probando","name":"gonzalo" }'
insert policy
g
I'm not familiar with the format you are showing, but possibly return=representation means return the record. Try setting a RLS for select and see if it works then.
f
with a rls for select it does work
will try switching the return off
g
"By default, every time you run insert(), the client library will make a select to return the full record. This is convenient, but it can also cause problems if your Policies are not configured to allow the select operation. If you are using Row Level Security and you are encountering problems, try setting the returning param to minimal."
f
that was it!!!!
you are a genius, thank you so much!
g
They really should switch this as it is biting lots of people. Including me.
f
seriously ... thank you ... was pulling my hair for the last couple of hours with this