-
-
Notifications
You must be signed in to change notification settings - Fork 266
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updates are not working #26
Comments
I will close this for now, I haven’t experienced this since I opened it and I am not sure how it happened. If I see it again I will create a repo to replicate it. |
Here were the ideas discussed on Slack, in case it gets reopened:
|
What's the possible fix for this? I'm getting same |
I'm having the same behaviour with
works fine. But this does not (404 error):
Having a 404 error. The endpoint is |
Same here. I'm using This works. const { data, error } = await supabase
.from('post_likes')
.select()
.match({ post_id: postId, account_id: accountId })
But this doesn't work. const { data, error } = await supabase
.from('post_likes')
.update({
read: true,
})
.match({ post_id: postId, account_id: accountId })
The response status of GET and DELETE methods are ok. |
I solved this problem by myself. There was something wrong with the update policy. create policy "Users can update their own like."
on comment_likes for update with check ( auth.role() = 'authenticated' ); I changed create policy "Users can update their own like."
on comment_likes for update using ( auth.role() = 'authenticated' ); Then, |
For anyone facing similar issues with other update queries, please note that
https://www.postgresql.org/docs/current/sql-createpolicy.html |
@AgarwalPragy You mean INSERT or UPSERT, right? I thought that UPDATE cannot add a new row. |
That is a little confusing actually. I just quoted the line direct from the postgres docs: https://www.postgresql.org/docs/current/sql-createpolicy.html It explicitly says
Probably means "rows that are created as a side effect of the update operation" - in case of triggers for example. |
Thanks, changed mine from this and it worked, what's the difference? |
Bug report
Describe the bug
I am running an update on a single row in the table
wedding
and it is 404ing. I've confirmed I am using the correct id and table. It seems the request being made is not correct.Here is the code:
The request url is:
If you break that down:
Why are both
neq
andeq
being applied and why isneq
there 4 times? Also, why is slug there? The slug was not included in the filter, just in the body.Screenshots
System information
The text was updated successfully, but these errors were encountered: