AppwriteException: Missing required parameter: "data" #5027
Answered
by
stnguyen90
kirtanchandak
asked this question in
Q&A
-
Hey I am getting this error!!AppwriteException: Missing required parameter: "data"const handleSumbit = async (e) => {
e.preventDefault();
const promise = databases.createDocument("ID", uuidv4(), {
todo,
});
promise.then(
function (response) {
console.log(response);
},
function (error) {
console.log(error);
}
);
e.target.reset(); |
Beta Was this translation helpful? Give feedback.
Answered by
stnguyen90
Jan 20, 2023
Replies: 2 comments 3 replies
-
@kirtanchandak, assuming you're using version 10.2.0 of the appwrite package, there are 4 required parameters, but you're only passing 3. async createDocument<Document extends Models.Document>(databaseId: string, collectionId: string, documentId: string, data: Omit<Document, keyof Models.Document>, permissions?: string[]): Promise<Document> Source: sdk-for-web FYI, you can use |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
stnguyen90
-
Actually it takes 5 parametersBut not I am getting an new error - AppwriteException: Invalid document structure: Unknown attribute: "0"
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@kirtanchandak, assuming you're using version 10.2.0 of the appwrite package, there are 4 required parameters, but you're only passing 3.
Source: sdk-for-web
FYI, you can use
ID.unique()
for a unique ID.