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,
}
);
await createUserInteraction(createdBy, "created", $id);
return $id;
} catch (error) {
console.log(error);
}
}