missing parse to int in put /games/:gameId

This commit is contained in:
Zamitto 2024-06-18 21:46:20 -03:00
parent 7eb69f6e16
commit cf84bf56b3
3 changed files with 3 additions and 3 deletions

View file

@ -4,7 +4,7 @@ import { HydraApi } from "../hydra-api";
export const createGame = async (game: Game) => { export const createGame = async (game: Game) => {
return HydraApi.post(`/games`, { return HydraApi.post(`/games`, {
objectId: game.objectID, objectId: game.objectID,
playTimeInMilliseconds: Math.round(game.playTimeInMilliseconds), playTimeInMilliseconds: Math.trunc(game.playTimeInMilliseconds),
shop: game.shop, shop: game.shop,
lastTimePlayed: game.lastTimePlayed, lastTimePlayed: game.lastTimePlayed,
}); });

View file

@ -7,7 +7,7 @@ export const updateGamePlaytime = async (
lastTimePlayed: Date lastTimePlayed: Date
) => { ) => {
return HydraApi.put(`/games/${game.remoteId}`, { return HydraApi.put(`/games/${game.remoteId}`, {
playTimeDeltaInSeconds: delta, playTimeDeltaInSeconds: Math.trunc(delta),
lastTimePlayed, lastTimePlayed,
}); });
}; };

View file

@ -18,7 +18,7 @@ export const uploadBatchGames = async () => {
chunk.map((game) => { chunk.map((game) => {
return { return {
objectId: game.objectID, objectId: game.objectID,
playTimeInMilliseconds: Math.round(game.playTimeInMilliseconds), playTimeInMilliseconds: Math.trunc(game.playTimeInMilliseconds),
shop: game.shop, shop: game.shop,
lastTimePlayed: game.lastTimePlayed, lastTimePlayed: game.lastTimePlayed,
}; };