Skip to content

Commit

Permalink
adjust api response (#3)
Browse files Browse the repository at this point in the history
Co-authored-by: NHT <[email protected]>
  • Loading branch information
nfesta2023 and hoangtuan910 authored Jan 17, 2024
1 parent 3cc4ab4 commit 8a1b298
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/service/otp.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ export class OtpService {
// const response = await sendOTPSMS(phoneNumber, otpInfo.OTP);
const response = otp;
result.statusCode = 200;
result.message = response;
result.message = 'Request OTP successfully';
result.data = response;
return result;
} catch (error) {
result.statusCode = 500;
Expand Down Expand Up @@ -95,7 +96,8 @@ export class OtpService {
await this.tokenService.updateRefreshToken(user, tokenData.refresh_token);

result.statusCode = 200;
result.message = tokenData;
result.message = 'Authenticate OTP successfully';
result.data = tokenData;
return result;
} catch (error) {
console.log(error);
Expand Down
3 changes: 2 additions & 1 deletion src/service/token.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ export class TokenService {
this.updateRefreshToken(user, tokenData.refresh_token);

result.statusCode = 200;
result.message = tokenData;
result.message = 'Refresh token successfully';
result.data = tokenData;
return result;
}
}
Expand Down

0 comments on commit 8a1b298

Please sign in to comment.