Skip to content

Commit

Permalink
Merge pull request #629 from BinaryStudioAcademy/fix/bt-612-fix-user-…
Browse files Browse the repository at this point in the history
…details-route

bt-612:  fix route
  • Loading branch information
katerynakostikova authored Sep 22, 2023
2 parents 712025e + 4fcd527 commit 08b2fdd
Showing 1 changed file with 19 additions and 12 deletions.
31 changes: 19 additions & 12 deletions mobile/src/bundles/talent/talent-api.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { ApiPath, ContentType } from '~/bundles/common/enums/enums';
import { UserDetailsApiPath } from '~/bundles/talent/enums/enums';
import {
type UserDetailsCreateRequestDto,
type UserDetailsGeneralRequestDto,
Expand All @@ -22,24 +23,30 @@ class TalentApi extends HttpApiBase {
public async completeTalentDetails(
payload: UserDetailsCreateRequestDto,
): Promise<UserDetailsResponseDto> {
const response = await this.load(this.getFullEndpoint('/', {}), {
method: 'POST',
contentType: ContentType.JSON,
payload: JSON.stringify(payload),
hasAuth: true,
});
const response = await this.load(
this.getFullEndpoint(UserDetailsApiPath.ROOT, {}),
{
method: 'POST',
contentType: ContentType.JSON,
payload: JSON.stringify(payload),
hasAuth: true,
},
);
return await response.json<UserDetailsResponseDto>();
}

public async completeOnboardingStep(
payload: UserDetailsGeneralRequestDto,
): Promise<UserDetailsGeneralRequestDto> {
const response = await this.load(this.getFullEndpoint('/', {}), {
method: 'PATCH',
contentType: ContentType.JSON,
payload: JSON.stringify(payload),
hasAuth: true,
});
const response = await this.load(
this.getFullEndpoint(UserDetailsApiPath.ROOT, {}),
{
method: 'PATCH',
contentType: ContentType.JSON,
payload: JSON.stringify(payload),
hasAuth: true,
},
);
return await response.json<UserDetailsGeneralRequestDto>();
}

Expand Down

0 comments on commit 08b2fdd

Please sign in to comment.