From c1479ca43ae14cdf68f12860afdcdb6a2a03f019 Mon Sep 17 00:00:00 2001
From: zkldi <20380519+zkldi@users.noreply.github.com>
Date: Sun, 24 Apr 2022 10:56:03 +0100
Subject: [PATCH] fix: update goals such that the app compiles again
---
.../games/_game/_playtype/GPTMainPage.tsx | 10 ++++-----
.../{UserGoalTable.tsx => GoalSubTable.tsx} | 21 ++++++++++++-------
client/src/types/api-returns.ts | 6 +++---
3 files changed, 21 insertions(+), 16 deletions(-)
rename client/src/components/tables/goals/{UserGoalTable.tsx => GoalSubTable.tsx} (79%)
diff --git a/client/src/app/pages/dashboard/games/_game/_playtype/GPTMainPage.tsx b/client/src/app/pages/dashboard/games/_game/_playtype/GPTMainPage.tsx
index bf8cf5b94..974e4370c 100644
--- a/client/src/app/pages/dashboard/games/_game/_playtype/GPTMainPage.tsx
+++ b/client/src/app/pages/dashboard/games/_game/_playtype/GPTMainPage.tsx
@@ -8,7 +8,7 @@ import { BarChartTooltip } from "components/charts/ChartTooltip";
import ClassBadge from "components/game/ClassBadge";
import useSetSubheader from "components/layout/header/useSetSubheader";
import Card from "components/layout/page/Card";
-import UserGoalTable from "components/tables/goals/UserGoalTable";
+import GoalSubTable from "components/tables/goals/GoalSubTable";
import ScoreTable from "components/tables/scores/ScoreTable";
import ApiError from "components/util/ApiError";
import AsyncLoader from "components/util/AsyncLoader";
@@ -33,7 +33,7 @@ import {
PublicUserDocument,
ScoreDocument,
SongDocument,
- UserGoalDocument,
+ GoalSubscriptionDocument,
} from "tachi-common";
import { RecentClassesReturn } from "types/api-returns";
import { GamePT } from "types/react";
@@ -77,7 +77,7 @@ function RecentAchievedGoalsComponent({ game, playtype }: GamePT) {
const { data, isLoading, error } = useApiQuery<{
users: PublicUserDocument[];
goals: GoalDocument[];
- userGoals: UserGoalDocument[];
+ goalSubs: GoalSubscriptionDocument[];
}>(`/games/${game}/${playtype}/goals/recently-achieved`);
if (error) {
@@ -93,7 +93,7 @@ function RecentAchievedGoalsComponent({ game, playtype }: GamePT) {
const userMap = CreateUserMap(data.users);
const goalMap = CreateGoalMap(data.goals);
- for (const userGoal of data.userGoals) {
+ for (const userGoal of data.goalSubs) {
const user = userMap.get(userGoal.userID);
const goal = goalMap.get(userGoal.goalID);
@@ -122,7 +122,7 @@ function RecentAchievedGoalsComponent({ game, playtype }: GamePT) {