#[Solved] AppwriteException: Invalid document structure: Missing required attribute "createdAt"

27 messages · Page 1 of 1 (latest)

raven grove
#
        await tablesDB.createRow({
            databaseId: '***',
            tableId: '***',
            rowId: user.$id,
            data
        });

why it require createdAt attribute the docs doesn't say so

unkempt plaza
#

data: {}

raven grove
#
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

cunning crest
raven grove
#

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

cunning crest
# raven grove

Look! Here's the exact reason behind your issue in your screenshot itself

raven grove
#

yes it worked after i removed them

#

createdAt and updatedAT

#

but am not sure how they got created

cunning crest
#

Great! Glad your problem is solved 😊

raven grove
#

Thank you @cunning crest

cunning crest
cunning crest
raven grove
cunning crest
#

Then you might've mistakenly created them. No worries. At least your issue is resolved now 👍🏻

raven grove
#

yes probably i did something wrong that lead to creation of them

#

thank you

cunning crest
raven grove
#

How

cunning crest
#

Just add "[Solved]" at the beginning of your post's title