Fixed createdAt
This commit is contained in:
parent
e5ec976652
commit
6b61164db0
3 changed files with 4 additions and 0 deletions
|
@ -132,6 +132,7 @@ export async function PUT(
|
||||||
oldRoom &&
|
oldRoom &&
|
||||||
(await db.insert(logs).values({
|
(await db.insert(logs).values({
|
||||||
id: `log_${createId()}`,
|
id: `log_${createId()}`,
|
||||||
|
created_at: Date.now().toString(),
|
||||||
userId: userId || "",
|
userId: userId || "",
|
||||||
roomId: params.roomId,
|
roomId: params.roomId,
|
||||||
scale: oldRoom.scale,
|
scale: oldRoom.scale,
|
||||||
|
|
|
@ -29,6 +29,7 @@ export async function PUT(
|
||||||
.insert(votes)
|
.insert(votes)
|
||||||
.values({
|
.values({
|
||||||
id: `vote_${createId()}`,
|
id: `vote_${createId()}`,
|
||||||
|
created_at: Date.now().toString(),
|
||||||
value: reqBody.value,
|
value: reqBody.value,
|
||||||
userId: userId || "",
|
userId: userId || "",
|
||||||
roomId: params.roomId,
|
roomId: params.roomId,
|
||||||
|
@ -36,6 +37,7 @@ export async function PUT(
|
||||||
.onConflictDoUpdate({
|
.onConflictDoUpdate({
|
||||||
target: [votes.userId, votes.roomId],
|
target: [votes.userId, votes.roomId],
|
||||||
set: {
|
set: {
|
||||||
|
created_at: Date.now().toString(),
|
||||||
value: reqBody.value,
|
value: reqBody.value,
|
||||||
userId: userId || "",
|
userId: userId || "",
|
||||||
roomId: params.roomId,
|
roomId: params.roomId,
|
||||||
|
|
|
@ -50,6 +50,7 @@ export async function POST(request: Request) {
|
||||||
.insert(rooms)
|
.insert(rooms)
|
||||||
.values({
|
.values({
|
||||||
id: `room_${createId()}`,
|
id: `room_${createId()}`,
|
||||||
|
created_at: Date.now().toString(),
|
||||||
userId: userId || "",
|
userId: userId || "",
|
||||||
roomName: reqBody.name,
|
roomName: reqBody.name,
|
||||||
storyName: "First Story!",
|
storyName: "First Story!",
|
||||||
|
|
Loading…
Add table
Reference in a new issue