Skip to content

Commit

Permalink
Adapt scores to return proper Score objects
Browse files Browse the repository at this point in the history
  • Loading branch information
desaxce committed Apr 9, 2024
1 parent 1b209d4 commit 16be0b5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -949,11 +949,12 @@ export class API {
return response;
}

async createScores(scores: Score[]) {
async createScores(scores: Score[]): Promise<Score[]> {
const query = createScoresQueryBuilder(scores);
const variables = variablesBuilder(scores);

return this.makeGqlCall(query, variables);
const result = await this.makeGqlCall(query, variables);
return Object.values(result.data).map((x: any) => new Score(x));
}

async createScore(variables: OmitUtils<Score>) {
Expand Down

0 comments on commit 16be0b5

Please sign in to comment.