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
- is `account.get()` safe to be used in th...
I want to user's `id` for authentication. However, a while ago I was told in this server not to use `account.get()` and instead add user preferences for that us...
- Usage of the new Client() and dealing wi...
Hey guys, just a quick one - we had some web traffic the other day and it ended up bombing out - To put in perspective of how the app works, we have a Nuxt Ap...
- CORS errors in Obsidian custom plugin
Hi, anyone here familiar with obsidian community plugins? In short: it's a local first note app which supports writing your own add-ons / plugin But I keep get...