mirror of
https://gitea.tendokyu.moe/pinapelz/Mirage.git
synced 2026-10-05 13:17:57 +03:00
fix recent games played sorting to prio date
This commit is contained in:
@@ -24,14 +24,18 @@ export const handleMeRoute = async (req: express.Request, res: express.Response)
|
||||
select: { id: true, username: true, isAdmin: true, bio: true }
|
||||
});
|
||||
const recentPlayedGames: RecentPlayedGame[] = await prisma.$queryRaw`
|
||||
SELECT DISTINCT ON (s."gameInternalName")
|
||||
g."formattedName",
|
||||
s."gameInternalName",
|
||||
s."timestamp"
|
||||
FROM "Score" s
|
||||
INNER JOIN "Game" g ON g."internalName" = s."gameInternalName"
|
||||
WHERE s."userId" = ${parseInt(userId as string)}
|
||||
ORDER BY s."gameInternalName", s."timestamp" DESC
|
||||
SELECT *
|
||||
FROM (
|
||||
SELECT DISTINCT ON (s."gameInternalName")
|
||||
g."formattedName",
|
||||
s."timestamp",
|
||||
s."gameInternalName"
|
||||
FROM "Score" s
|
||||
INNER JOIN "Game" g ON g."internalName" = s."gameInternalName"
|
||||
WHERE s."userId" = ${parseInt(userId as string)}
|
||||
ORDER BY s."gameInternalName", s."timestamp" DESC
|
||||
) sub
|
||||
ORDER BY sub."timestamp" DESC
|
||||
LIMIT 5;
|
||||
`;
|
||||
const scoreCountByGame: SafeGameCount[] = await prisma.$queryRaw`
|
||||
|
||||
Reference in New Issue
Block a user