fix: adjust when calling /games/download

This commit is contained in:
Zamitto 2024-09-16 14:07:00 -03:00
parent ec16efed2f
commit cc5967814b
2 changed files with 12 additions and 13 deletions

View file

@ -1,20 +1,8 @@
import { Game } from "@main/entity";
import { HydraApi } from "../hydra-api";
import { gameRepository } from "@main/repository";
import { logger } from "../logger";
export const createGame = async (game: Game) => {
HydraApi.post(
"/games/download",
{
objectId: game.objectID,
shop: game.shop,
},
{ needsAuth: false }
).catch((err) => {
logger.error("Failed to create game download", err);
});
return HydraApi.post(`/profile/games`, {
objectId: game.objectID,
playTimeInMilliseconds: Math.trunc(game.playTimeInMilliseconds),