This repository has been archived by the owner on Jan 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4110 from DivanteLtd/hotfix/v1.10.6
Hotfix/v1.10.6
- Loading branch information
Showing
46 changed files
with
376 additions
and
191 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
export const hasResponseError = (jsonResponse): boolean => { | ||
if (typeof jsonResponse.result === 'string') { | ||
return true | ||
} | ||
|
||
const hasMessage = jsonResponse.result.result || jsonResponse.result.message | ||
|
||
return Boolean(hasMessage) && jsonResponse.result.code !== 'ENOTFOUND' | ||
} | ||
|
||
export const getResponseMessage = (jsonResponse): string => { | ||
if (typeof jsonResponse.result === 'string') { | ||
return jsonResponse.result | ||
} | ||
|
||
if (typeof jsonResponse.result.result === 'string') { | ||
return jsonResponse.result.result | ||
} | ||
|
||
return jsonResponse.result.message | ||
} | ||
|
||
export const getResponseCode = (jsonResponse): number => { | ||
let responseCode = null | ||
if (jsonResponse.result && jsonResponse.result.code) { | ||
responseCode = parseInt(jsonResponse.result.code) | ||
} else { | ||
responseCode = parseInt(jsonResponse.code) | ||
} | ||
return responseCode | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.