Skip to content

Commit

Permalink
fix(app-grants): fix raw response structure
Browse files Browse the repository at this point in the history
  • Loading branch information
Mirasaki committed Aug 14, 2024
1 parent 02e8392 commit 31924e9
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 31924e9

Please # to comment.