Back

message: "Server Error", code: 500, type: "general_unknown", version: "0.10.37"} code : 500message

  • 0
  • Databases
  • Web
Deepanshu Goel
13 Jun, 2023, 00:21

HI, I was creating the new entry for the database in nextjs with databases.createDocument and getting this error when I was adding.

Code Reference

TypeScript
export const createIdea = async (idea: string, type: string, createdBy: string) => {
    const { databases } = useAppwrite();
    try {
        const { $id } = await databases.createDocument(
            DATABASE_ID, IDEAS_COLLECTION_ID, ID.unique(), {
                idea,
                type,
            createdBy,
        }
        );

        // create the user interaction for the user who created the idea
        await createUserInteraction(createdBy, "created", $id);
        return $id;
    } catch (error) {
        console.log(error);
    }

}
TL;DR
The user encountered a server error with a code of 500 when trying to create a new entry in the database using `databases.createDocument` in Next.js. They provided a code reference for the function. No solution is mentioned.
Deepanshu Goel
13 Jun, 2023, 01:08

Thank you.

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more