aboutsummaryrefslogtreecommitdiffstats
path: root/backend
diff options
context:
space:
mode:
Diffstat (limited to 'backend')
-rw-r--r--backend/schema.prisma1
-rw-r--r--backend/src/routes/score.ts2
2 files changed, 3 insertions, 0 deletions
diff --git a/backend/schema.prisma b/backend/schema.prisma
index 0657fdf..49dea07 100644
--- a/backend/schema.prisma
+++ b/backend/schema.prisma
@@ -36,6 +36,7 @@ model Score {
id Int @id @default(autoincrement())
gameInternalName String
userId Int
+ timestamp Int //in UNIX milliseconds
data Json
game Game @relation(fields: [gameInternalName], references: [internalName])
user User @relation(fields: [userId], references: [id])
diff --git a/backend/src/routes/score.ts b/backend/src/routes/score.ts
index 03026af..9e9c597 100644
--- a/backend/src/routes/score.ts
+++ b/backend/src/routes/score.ts
@@ -1,5 +1,6 @@
import express from 'express';
import { prisma } from '../config/db';
+import { timeStamp } from 'node:console';
export const handleScoreUpload = async (req: express.Request, res: express.Response) => {
try {
@@ -32,6 +33,7 @@ export const handleScoreUpload = async (req: express.Request, res: express.Respo
data: scoresArray.map(scoreData => ({
gameInternalName: internalGameName,
userId: userId,
+ timestamp: scoreData.timestamp,
data: scoreData
}))
});
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage