Skip to content

Commit

Permalink
refactor: add transformResponse function for safe JSON parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
arhamj authored and jairajdev committed Jun 17, 2024
1 parent a2642ac commit 6083c66
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/class/DataSync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ export const queryFromDistributor = async (type: DataType, queryParameters: any)
'Content-Type': 'application/json',
},
timeout: 30000,
transformResponse: (res) => {
return StringUtils.safeJsonParse(res)
},
})
return response
} catch (e) {
Expand Down

0 comments on commit 6083c66

Please sign in to comment.