Skip to content

Commit

Permalink
fixed token retrieval
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam committed Dec 5, 2023
1 parent e3b12f0 commit ac9d3c2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/app/@api/base.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ export class BaseApi<T> {

protected request<T>(func: WEN_FUNC, req: WenRequest): Observable<T | undefined> {
const origin = environment.production ? BUILD5_PROD_ADDRESS_API : BUILD5_TEST_ADDRESS_API;
return this.httpClient.post(origin + func, req).pipe(map((b: any) => b.data));
return <any>this.httpClient.post(origin + func, req);

Check warning on line 39 in src/app/@api/base.api.ts

View workflow job for this annotation

GitHub Actions / front_end_es_lint

Unexpected any. Specify a different type
}
}
16 changes: 12 additions & 4 deletions src/app/@api/member.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import {
Transaction,
WEN_FUNC,
WenRequest,
BUILD5_PROD_ADDRESS_API,
BUILD5_TEST_ADDRESS_API,
} from '@build-5/interfaces';
import {
AirdropRepository,
Expand Down Expand Up @@ -226,14 +228,20 @@ export class MemberApi extends BaseApi<Member> {

public createIfNotExists = (address: string): Observable<Member | undefined> =>
this.request(WEN_FUNC.createMember, {
address: '',
address: address,
projectApiKey: environment.build5Token,
body: address,
body: {
address,
},
});

public updateMember = (req: WenRequest): Observable<Member | undefined> =>
this.request(WEN_FUNC.updateMember, req);

public generateAuthToken = (req: WenRequest): Observable<string | undefined> =>
this.request(WEN_FUNC.generateCustomToken, req);
public generateAuthToken = (req: WenRequest): Observable<string | undefined> => {
const origin = environment.production ? BUILD5_PROD_ADDRESS_API : BUILD5_TEST_ADDRESS_API;
return <any>this.httpClient.post(origin + WEN_FUNC.generateCustomToken, req, {

Check warning on line 243 in src/app/@api/member.api.ts

View workflow job for this annotation

GitHub Actions / front_end_es_lint

Unexpected any. Specify a different type
responseType: 'text',
});
};
}

0 comments on commit ac9d3c2

Please sign in to comment.