add: create, update and login dates in database

This commit is contained in:
rasmusq
2025-12-19 20:50:06 +01:00
parent d51000ae7c
commit e1ddf1e5c9
7 changed files with 43 additions and 13 deletions
+3 -3
View File
@@ -85,7 +85,7 @@ export const actions: Actions = {
}
await db.update(wishlists)
.set({ isFavorite: !isFavorite })
.set({ isFavorite: !isFavorite, updatedAt: new Date() })
.where(eq(wishlists.id, wishlistId));
return { success: true };
@@ -171,7 +171,7 @@ export const actions: Actions = {
}
await db.update(users)
.set({ dashboardTheme: theme })
.set({ dashboardTheme: theme, updatedAt: new Date() })
.where(eq(users.id, session.user.id));
return { success: true };
@@ -187,7 +187,7 @@ export const actions: Actions = {
const color = formData.get('color') as string | null;
await db.update(users)
.set({ dashboardColor: color })
.set({ dashboardColor: color, updatedAt: new Date() })
.where(eq(users.id, session.user.id));
return { success: true };
@@ -155,7 +155,7 @@
{#if showAddForm}
<div bind:this={addFormElement}>
<AddItemForm onSuccess={handleItemAdded} />
<AddItemForm onSuccess={handleItemAdded} wishlistColor={currentColor} wishlistTheme={currentTheme} />
</div>
{/if}
@@ -169,6 +169,8 @@
currentPosition={items.findIndex(item => item.id === editingItem.id) + 1}
totalItems={items.length}
onPositionChange={handlePositionChange}
wishlistColor={currentColor}
wishlistTheme={currentTheme}
/>
</div>
{/if}