Skip to content

Commit

Permalink
feat: won timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
qin-guan committed Jul 23, 2023
1 parent 4c46b05 commit 6ad5c28
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pages/dashboard/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,8 @@ async function copy() {
<Column field="id" header="ID" style="width: 30%" />
<Column field="name" header="Name" :sortable="true" style="width: 20%" />
<Column field="nric" header="NRIC" :sortable="true" style="width: 20%" />
<Column field="phone" header="Phone" :sortable="true" style="width: 20%" />
<Column field="phone" header="Phone" :sortable="true" style="width: 10%" />
<Column field="wonTime" header="Timestamp" :sortable="true" style="width: 10%" />
<Column header="Delete" style="width: 10%">
<template #body="slotProps">
<Button label="Delete" size="small" severity="danger" @click="deleteWinner(slotProps.data.id)" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "User" ADD COLUMN "wonTime" TIMESTAMP(3);
1 change: 1 addition & 0 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ model User {
admin Boolean
won Boolean?
wonTime DateTime?
surveyResponses Response[]
}
Expand Down
1 change: 1 addition & 0 deletions server/trpc/routers/lucky-draw/lucky-draw.router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ export const luckyDrawRouter = router({
},
data: {
won: true,
wonTime: new Date(),
},
})
}),
Expand Down

0 comments on commit 6ad5c28

Please sign in to comment.