#[Solved] AppwriteException: Invalid document structure: Missing required attribute "createdAt"
27 messages · Page 1 of 1 (latest)
data: {}
export const UpdateTheme = command(UpdateThemeSchema, async (data) => {
const user = RequireAuth();
const { tablesDB } = getAdminServices();
try {
await tablesDB.upsertRow({
databaseId,
tableId: 'theme',
rowId: user.$id,
data
});
} catch (error) {
console.log(error);
}
});
am passing it correctly
The createdAt is a default column which automatically gets created when you create any DB Table. Have you explicitly created any similar column and mentioned it as required somewhere in your code?
no i didn't
export const UpdateThemeSchema = v.object({
Background: HexColor,
Secondary: HexColor,
FontPrimary: HexColor,
FontSecondary: HexColor,
Icons: HexColor,
Shadow: HexColor
});
this is my data Schema
let me check the database in the console maybe it get created by mistake somehow
hmm that is weird i didn't create them!
but they exist somehow
Thank you for helping
Look! Here's the exact reason behind your issue in your screenshot itself
yes it worked after i removed them
createdAt and updatedAT
but am not sure how they got created
Great! Glad your problem is solved 😊
Thank you @cunning crest
How exactly you created the columns for this table?
Anytime!
manually from the dashboard
Then you might've mistakenly created them. No worries. At least your issue is resolved now 👍🏻
Please mark this post as SOLVED since your issue is resolved now
How
Just add "[Solved]" at the beginning of your post's title