Skip to content

Commit

Permalink
Merge pull request #14 from Mirasaki/main
Browse files Browse the repository at this point in the history
fix(app-grants): fix raw response structure
  • Loading branch information
FlorianSW authored Aug 14, 2024
2 parents 02e8392 + 31924e9 commit 497f5a0
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/internal/got/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,10 @@ interface RawServerAppGrant {

interface RawAppGrants {
status: boolean;
banlist: RawBanListAppGrant[],
server: RawServerAppGrant[],
tokens?: {
banlist?: RawBanListAppGrant[];
server?: RawServerAppGrant[];
};
}

export class GotCFToolsClient implements CFToolsClient {
Expand All @@ -99,12 +101,12 @@ export class GotCFToolsClient implements CFToolsClient {
},
});
return {
banlist: response.banlist?.map((e) => ({
banlist: response.tokens?.banlist?.map((e) => ({
...e,
created: new Date(e.created_at),
created_at: undefined
})) ?? [],
server: response.server?.map((e) => ({
server: response.tokens?.server?.map((e) => ({
...e,
created: new Date(e.created_at),
created_at: undefined
Expand Down

0 comments on commit 497f5a0

Please # to comment.