Rank 2: Process
When you load the document, what does it look like? Can you send...
Votes
0
Replies
24
Participants
Unknown
Messages
25
Rank 2: Process
When you load the document, what does it look like? Can you send...
Rank 3: Container
It's like this
Rank 2: Process
I mean data from function "getDocument"
Rank 3: Container
I'm using listDocument
Rank 2: Process
So that
Rank 3: Container
and the data which I'm getting is in the above image only
Rank 3: Container
Here I'm trying to update a document
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); } ); };Rank 2: Process
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?
Admin
Did the original poster mention anything about malformed permissions? 🧐
Rank 3: Container
At first it was running only once
Rank 3: Container
So, I created this support issue
Rank 3: Container
After that I closed my laptop for 3hrs
Rank 3: Container
then when I tried to check
Rank 3: Container
Nothing is working
Rank 3: Container
Current problem: Document is not getting updated
Rank 3: Container
The code is above
Rank 3: Container
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
Rank 3: Container
Okay, let me try
Rank 3: Container
Hey, thanks
Rank 3: Container
It's working fine now
Rank 3: Container
[SOLVED] update document is working only once and not twice or more