I'm using appwrite in a client without SDK.
I'm trying to use data.updateDocument() method but getting CORS error.
However GET, POST and other methods work well.
I'm not sure, but I think the problem is with the PATCH method.
How can I solve this? ( i'm using NextJS14 ).
Did it work before?
@k_vasen No, it didn't work from the start
can you show code
please
What are the permissions on the collection and document?
@ZachHandley Here is the code
@Steven I have enabled all document permissions
But with postman, it is working
Postman typically ignores CORS
Does the collection have any relationship attributes?
@Steven yes, columnId is a relationship attr that related to columns
What are the permissions on that collection?
ah smart
@Steven I've enabled all permissions in all collections
And you're getting the same error still?
@Steven yes
Here I created route handler, this is a request from server with "node-appwrite" and it works fine.
But it gives CORS on update when I try to do a client request with "appwrite" on the client side ?
@Steven Is it possible to set headers for the "updateDocument" of "appwrite" function on the client side?
No, that would be a security vulnerability
This code seems not to to be the code you should be using
What's the SDK version you're using?
@D5 here is the version, but actually the main problem is not in SDK but in "appwrite", cuz I'm trying to use it on client side, I think you understand that
since an update method of appwrite is giving CORS, I will use node-appwrite in Nextjs , i think this is the only way I can do
NextJS uses server-side rendering. You should disable it for now for an easier development
Recommended threads
- TablesDB `updateRows` returns `database_...
Hi Appwrite team! I’m seeing a strange issue with TablesDB bulk row updates on a self-hosted Appwrite instance. **Environment** - Appwrite self-hosted `1.9.0` ...
- [SOLVED] Realtime Missing Channels
```js useEffect(() => { let subscription: RealtimeSubscription; async function loadChips() { try { const {rows: chi...
- Update row sheet not loading
After right clicking a row header and click update, the sidebar fails to load (never-ending skeleton)