feat: announce target achievements

This commit is contained in:
zkldi
2022-11-26 16:04:43 +00:00
parent c97c1ffab1
commit ed7e49e770
6 changed files with 72 additions and 7 deletions
+14
View File
@@ -12,6 +12,7 @@ import type {
integer,
PBScoreDocument,
Playtype,
QuestDocument,
SongDocument,
UserDocument,
} from "tachi-common";
@@ -54,6 +55,19 @@ export async function GetGoalWithID(goalID: string, game: Game, playtype: Playty
return res.body;
}
export async function GetQuestWithID(questID: string, game: Game, playtype: Playtype) {
const res = await TachiServerV1Get<QuestDocument>(
`/games/${game}/${playtype}/targets/quests/${questID}`,
null
);
if (!res.success) {
throw new Error(`Failed to fetch goal with ID ${questID}. '${res.description}'.`);
}
return res.body;
}
export async function GetChartInfoForUser(
userID: integer | string,
chartID: string,