I have created a blog website in REACT. When I try to post, sometimes an error is shown.
try{
return await this.databases.createDocument(
conf.appwriteDatabaseId,
conf.appwriteCollectionId,
slug,
{
title,
content,
featuredImage,
status,
userId,
}
)
}
catch(error){
console.log("Appwrite serive :: createPost :: error", error);
}
}```
@Binyamin @Arman
@D5
Please, avoid pinging core members if it's not necessarily 😅
okay
Looks like userId is required, but you're not specifying it?
Also, do you can see the data being saved in the console at all? I think that it doesn't have a proper structure (Json-like)
It's not that it never happens, sometimes it gets posted
Hmm then maybe you're not specifying the user ID? Anyways, I recommend doing that in a function to prevent manipulation
How to specify the user ID
?
You have here an userId attribute
yup
i am so frustrated
It is not getting solved
see
use ID.unique
const newAccount = await account.create( ID.unique(), user.email, user.password, user.name );
like this
Recommended threads
- Update User Error
```ts const { users, databases } = await createAdminClient(); const session = await getLoggedInUser(); const user = await users.get(session.$id); if (!use...
- apple exchange code to token
hello guys, im new here 🙂 I have created a project and enabled apple oauth, filled all data (client id, key id, p8 file itself etc). I generate oauth code form...
- How to Avoid Double Requests in function...
I'm currently using Appwrite's `functions.createExecution` in my project. I want to avoid double requests when multiple actions (like searching or pagination) a...