When you load the document, what does it look like? Can you send...
It's like this
I mean data from function "getDocument"
I'm using listDocument
So that
and the data which I'm getting is in the above image only
Here I'm trying to update a document
I'm trying to understand the problem
So this function runs only once?
const editTips = (id) => {
const promise = databases.updateDocument(databaseId,
collectionId, id, data);
promise.then(
function(response) {
toast.success('Productivity tip updated successfully!!');
console.log(response);
// window.location.reload()
},
function(error) {
toast.error(error.message);
console.log(error);
}
);
};
I had a same issue, it was that when you updated document, permissions then transform from string[] into object, then you can't update document twice, but in this case, there should be an err
Interesting, but why the permissions were deleted? have you send the permissions
as an empty array?
Did the original poster mention anything about malformed permissions? π§
At first it was running only once
So, I created this support issue
After that I closed my laptop for 3hrs
then when I tried to check
Nothing is working
Current problem: Document is not getting updated
The code is above
I have changed nothing
@Susmita In my personal experience, the <form>
tag is a pain to work with (again, just my preference). Could you try getting rid of the form
tag, and replacing it with a simple div
? Also get rid of the type="submit"
in the button. For now, try to just click the button manually.
Another thing to check is the form
's action
property. It's blank, which if I'm not wrong will basically refresh your page.
Try these things and let me know
Okay, let me try
Hey, thanks
It's working fine now
[SOLVED] update document is working only once and not twice or more
Recommended threads
- Need Help with Google OAuth2 in Expo usi...
I'm learning React Native with Expo and trying to set up Google OAuth2 with Appwrite. I couldn't find any good docs or tutorials for this and my own attempt did...
- 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...
- Got message for auto payment of 15usd fo...
how did this happen? 1. i claimed my 50usd credits via jsm hackathon - https://hackathon.jsmastery.pro/ 2. it asked me which org. to apply the credits on, i se...