diff --git a/src/app/@api/base.api.ts b/src/app/@api/base.api.ts index e31d7f2..26d8d5a 100644 --- a/src/app/@api/base.api.ts +++ b/src/app/@api/base.api.ts @@ -36,6 +36,6 @@ export class BaseApi { protected request(func: WEN_FUNC, req: WenRequest): Observable { 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 this.httpClient.post(origin + func, req); } } diff --git a/src/app/@api/member.api.ts b/src/app/@api/member.api.ts index 321f032..cfddf69 100644 --- a/src/app/@api/member.api.ts +++ b/src/app/@api/member.api.ts @@ -16,6 +16,8 @@ import { Transaction, WEN_FUNC, WenRequest, + BUILD5_PROD_ADDRESS_API, + BUILD5_TEST_ADDRESS_API, } from '@build-5/interfaces'; import { AirdropRepository, @@ -226,14 +228,20 @@ export class MemberApi extends BaseApi { public createIfNotExists = (address: string): Observable => this.request(WEN_FUNC.createMember, { - address: '', + address: address, projectApiKey: environment.build5Token, - body: address, + body: { + address, + }, }); public updateMember = (req: WenRequest): Observable => this.request(WEN_FUNC.updateMember, req); - public generateAuthToken = (req: WenRequest): Observable => - this.request(WEN_FUNC.generateCustomToken, req); + public generateAuthToken = (req: WenRequest): Observable => { + const origin = environment.production ? BUILD5_PROD_ADDRESS_API : BUILD5_TEST_ADDRESS_API; + return this.httpClient.post(origin + WEN_FUNC.generateCustomToken, req, { + responseType: 'text', + }); + }; }