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
- Query Appwrite
Hello, I have a question regarding Queries in Appwrite. If I have a string "YYYY-MM", how can I query the $createdAt column to match this filter?
- Different appwrite IDs are getting expos...
File_URL_FORMAT= https://cloud.appwrite.io/v1/storage/buckets/[BUCKET_ID]/files/[FILE_ID]/preview?project=[PROJECT_ID] I'm trying to access files in my web app...
- Invalid document structure: missing requ...
I just pick up my code that's working a week ago, and now I got this error: ``` code: 400, type: 'document_invalid_structure', response: { message: 'Inv...