
Is this the way you're running the function now?

yes

Okay. can you run this
- Change from UDID to Appwrite's
ID.unique
- Change the
data
to be object.
And check the logs?
import {ID, databases } from '../appwrite/appwriteConfig'
const data = {todo:todoItem};
console.log(data);
const promise = databases.createDocument("ID","ID", ID.unique(), data);
Export ID in appwriteConfig

export database and collection id?

I mean the ID function But you can do it like this for testing
import {databases } from '../appwrite/appwriteConfig'
import {ID} from "appwrite";
const data = {todo:todoItem};
console.log(data);
const promise = databases.createDocument("ID","ID", ID.unique(), data);

okay, let me try

Hey @Binyamin thanks for your help

didn't have to go through this

just reloaded and restarted the server

and it's up and running automatically

But yes, this was important thing

So now it works?

Yes but stuck with delete todo item

What's the issue?

It's not showing any errors and also not deleted the item.

Code:
const deleteTodo = (id) => {
const promise = databases.deleteDocument("ID", "I", id)
promise.then(
function (response) {
console.log(response);
},
function (error) {
console.log(error);
}
)
window.location.reload()
}

<div>
{todos && todos.map(item => (
<div key={item.$id} >
<div className="p-4 flex items-center justify-between border-b-2 bg-gray-100 rounded-lg mb-1">
<div>
<p>{item.todo}</p>
</div>
<div>
<span
className="text-red-400 cursor-pointer"
onClick={() => {
deleteTodo(item.$id)
}}
>
Delete
</span>
</div>
</div>
</div>

The value of the ID's here is just for the example?
const promise = databases.deleteDocument("ID", "I", id)
Am I right?

yes

actually it's typo mistake

BTW, because you running it on sync mode it will be better to move the reload function inside the functions
const deleteTodo = (id) => {
const promise = databases.deleteDocument("ID", "I", id)
promise.then(
function (response) {
console.log(response);
window.location.reload()
},
function (error) {
console.log(error);
window.location.reload()
}
)
}

okay

Hey, thanks

Working perfectly now

[SOLVED] : AppwriteException: Missing required parameter: "data"
Recommended threads
- Subdomain failed verification
So I wanted to do a custom subdomain, because local storage doesn't work for me, but I've tried it a long time ago, it didn't work for me, and now I'm trying ag...
- [Node.js SDK] Bypass 2GB file limit?
Hello. Using either InputFile.fromPath or InputFile.fromBuffer throws this error: File size (2295467305) is greater than 2 GiB Bucket limit etc. is setup corre...
- Relationship null, even when relationshi...
Hi Everyone, im experiencing issues with set relation data. When im setting the document id from the related database most of them seem fine, except one table. ...
