feat: achievement section for user not logged in

This commit is contained in:
Zamitto 2024-10-13 21:14:06 -03:00
parent a064958d4c
commit a4475d2145
7 changed files with 131 additions and 19 deletions

View file

@ -4,6 +4,7 @@ import {
} from "@main/repository";
import { HydraApi } from "../hydra-api";
import { AchievementData } from "@types";
import { UserNotLoggedInError } from "@shared";
export const getGameAchievementData = async (
objectId: string,
@ -30,7 +31,11 @@ export const getGameAchievementData = async (
return achievements;
})
.catch(() => {
.catch((err) => {
if (err instanceof UserNotLoggedInError) {
throw err;
}
return gameAchievementRepository
.findOne({
where: { objectId, shop },