Fixed createdAt

This commit is contained in:
Atridad Lahiji 2023-10-03 00:58:00 -06:00
parent 6c6589250d
commit b4c0b3bd53
No known key found for this signature in database
3 changed files with 4 additions and 0 deletions

View file

@ -132,6 +132,7 @@ export async function PUT(
oldRoom &&
(await db.insert(logs).values({
id: `log_${createId()}`,
created_at: Date.now().toString(),
userId: userId || "",
roomId: params.roomId,
scale: oldRoom.scale,

View file

@ -29,6 +29,7 @@ export async function PUT(
.insert(votes)
.values({
id: `vote_${createId()}`,
created_at: Date.now().toString(),
value: reqBody.value,
userId: userId || "",
roomId: params.roomId,
@ -36,6 +37,7 @@ export async function PUT(
.onConflictDoUpdate({
target: [votes.userId, votes.roomId],
set: {
created_at: Date.now().toString(),
value: reqBody.value,
userId: userId || "",
roomId: params.roomId,

View file

@ -50,6 +50,7 @@ export async function POST(request: Request) {
.insert(rooms)
.values({
id: `room_${createId()}`,
created_at: Date.now().toString(),
userId: userId || "",
roomName: reqBody.name,
storyName: "First Story!",