Skip to content

Commit

Permalink
Update API call parameters (#99)
Browse files Browse the repository at this point in the history
Co-authored-by: Justin Herrera <[email protected]>
  • Loading branch information
justinnout and Justin Herrera authored Nov 22, 2022
1 parent a40a236 commit eecbdca
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/modules/users/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export class UsersModule extends BaseModule {
oauth_provider: string | null;
phone_number: string | null;
wallets: MagicWallet[] | null;
}>(`${this.sdk.apiBaseUrl}/v1/admin/auth/user/get?wallet_type=${walletType}`, this.sdk.secretApiKey, { issuer });
}>(`${this.sdk.apiBaseUrl}/v1/admin/auth/user/get`, this.sdk.secretApiKey, { issuer, wallet_type: walletType });

return {
issuer: data.issuer ?? null,
Expand Down
12 changes: 6 additions & 6 deletions test/spec/modules/users/getMetadataByIssuer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ test('Successfully GETs to metadata endpoint via issuer', async () => {

const getArguments = getStub.mock.calls[0];
expect(getArguments).toEqual([
'https://example.com/v1/admin/auth/user/get?wallet_type=NONE',
'https://example.com/v1/admin/auth/user/get',
API_KEY,
{ issuer: 'did:ethr:0x1234' },
{ issuer: 'did:ethr:0x1234', wallet_type: 'NONE'},
]);
expect(result).toEqual({
issuer: 'foo',
Expand All @@ -61,9 +61,9 @@ test('Successfully GETs `null` metadata endpoint via issuer', async () => {

const getArguments = getStub.mock.calls[0];
expect(getArguments).toEqual([
'https://example.com/v1/admin/auth/user/get?wallet_type=NONE',
'https://example.com/v1/admin/auth/user/get',
API_KEY,
{ issuer: 'did:ethr:0x1234' },
{ issuer: 'did:ethr:0x1234', wallet_type: 'NONE' },
]);
expect(result).toEqual({
issuer: null,
Expand Down Expand Up @@ -98,9 +98,9 @@ test('Successfully GETs to metadata endpoint via issuer and wallet type', async

const getArguments = getStub.mock.calls[0];
expect(getArguments).toEqual([
'https://example.com/v1/admin/auth/user/get?wallet_type=SOLANA',
'https://example.com/v1/admin/auth/user/get',
API_KEY,
{ issuer: 'did:ethr:0x1234' },
{ issuer: 'did:ethr:0x1234', wallet_type: 'SOLANA'},
]);
expect(result).toEqual({
issuer: 'foo',
Expand Down

0 comments on commit eecbdca

Please sign in to comment.