Skip to content

Commit

Permalink
fix: stringify same as toString in this case
Browse files Browse the repository at this point in the history
  • Loading branch information
g-saracca committed Feb 24, 2025
1 parent f283815 commit 3b3f380
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/core/infra/repositories/ApiRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,8 @@ export abstract class ApiRepository {
let requestData = data

if (contentType === ApiConstants.CONTENT_TYPE_APPLICATION_JSON) {
if (typeof data === 'object') {
if (typeof data === 'object' || typeof data === 'boolean') {
requestData = JSON.stringify(data)
} else if (typeof data === 'boolean') {
requestData = data.toString()
}
}

Expand Down

0 comments on commit 3b3f380

Please sign in to comment.