Fix SimplePBDocument interface

This commit is contained in:
Pfych
2021-10-02 10:34:24 +10:00
parent 76df51f59f
commit 6d1f2f9f1b
+3 -7
View File
@@ -31,10 +31,7 @@ export const buildSongSelect = <T extends Game>(songs: SongSearchResult[], playt
);
};
interface SimplePBDocument
extends Pick<PBScoreDocument, "scoreData">,
Pick<PBScoreDocument, "calculatedData">,
Partial<PublicUserDocument> {}
interface SimplePBDocument extends PBScoreDocument, Partial<PublicUserDocument> {}
export const getPBForChart = async <T extends Game>(
chartId: string,
@@ -51,9 +48,8 @@ export const getPBForChart = async <T extends Game>(
const topUser = users.find((user) => user.id === topPb.userID);
return {
...topUser,
scoreData: topPb.scoreData,
calculatedData: topPb.calculatedData
...topPb,
...topUser
};
} else {
logger.error(data.description);