add: create, update and login dates in database
This commit is contained in:
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user