@Paul Soriano From what I'm seeing there, did you have setup permissions in console, specifically write permission in the collections for this user?
yes,
I did setup permission as any
Are you sure all params are valid? Put values like creator, etc in the JSON as a string (between "")
Otherwise the JSON is invalid
as I have checked it. all are valid.
and I tried only to lessen the passing values, still not working
And did you have tried setting it like this:
{
"title": "Hamlet"
}```
const newPost = await databases.createDocument( appwriteConfig.databaseId, appwriteConfig.postCollectionId, ID.unique(), { creator: post.userId, caption: post.caption, // imageUrl: fileUrl.href, // imageId: uploadedFile.$id, location: post.location, tags: tags, } );
i have this
I just follow the documentation
Try this:
const newPost = await databases.createDocument(
appwriteConfig.databaseId,
appwriteConfig.postCollectionId,
ID.unique(),
{
"creator": post.userId,
"caption": post.caption,
// "imageUrl": fileUrl.href,
// "imageId": uploadedFile.$id,
"location": post.location,
"tags": tags,
}
);
ok, I will
still the same
I actually have the same save in user collection and it works fine with this: export async function saveUserToDB(user: { accountId: string; email: string; name: string; imageUrl: URL; username?: string; }) { try { const newUser = await databases.createDocument( appwriteConfig.databaseId, appwriteConfig.userCollectionId, ID.unique(), user );
return newUser;
} catch (error) { console.log(error); } }
Probably the relationship is not valid 🤔
Or you don't have access to the related collection
I will review the relation and will get back to you
omg it works, you're right. its the relationship issue between posts and my users collection.
I can closed this now @D5 . thank you so much for your help. have a nice day.
Great! <:appwritepeepo:1156975874852270110>
Glad to hear it got solved
[SOLVED] Unable to save data Server Error 500
@Paul Soriano can we close this issue? https://github.com/appwrite/appwrite/issues/7141
Recommended threads
- Project paused?
Hello, I have two Appwrite projects and I can not resume them for some reason. I'm using the free plan, and I saw in the pricing page that 2 free projects are a...
- Authentication on custom Websocket Serve...
Hi, I want to use a custom Websocket Server (using Bun) for my application. However I cant really figure out authentication on custom servers. Session cookies ...
- Realtime for files() works almost well, ...
I have been trying to make use of realtime, today (14.03.26) I have pulled all the latest versions of docker images, and sdk available. Whats working: - Conn...