Skip to content

Commit

Permalink
fix(accountsinfo): fix response format
Browse files Browse the repository at this point in the history
  • Loading branch information
meriamBenSassi committed Sep 11, 2023
1 parent 9b65cfd commit 2a74bdd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/aggregator/services/bridge/bridge.client.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ describe('BridgeClient', () => {

it('can get the account information', async () => {
const result: AxiosResponse = {
data: mockAccountInformation,
data: { resources: mockAccountInformation },
status: 200,
statusText: '',
headers: {},
Expand Down
4 changes: 2 additions & 2 deletions src/aggregator/services/bridge/bridge.client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -337,13 +337,13 @@ export class BridgeClient {
public async getAccountInformation(accessToken: string, clientConfig?: ClientConfig): Promise<AccountInformation[]> {
const url: string = `${config.bridge.baseUrl}/v2/accounts-information`;

const resp: AxiosResponse<AccountInformation[]> = await BridgeClient.toPromise(
const resp: AxiosResponse<{ resources: AccountInformation[] }> = await BridgeClient.toPromise(
this.httpService.get(url, {
headers: { Authorization: `Bearer ${accessToken}`, ...BridgeClient.getHeaders(clientConfig) },
}),
);

return resp.data;
return resp.data.resources;
}

/**
Expand Down

0 comments on commit 2a74bdd

Please sign in to comment.