diff options
author | crupest <crupest@outlook.com> | 2020-07-13 20:59:52 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2020-07-13 20:59:52 +0800 |
commit | 6f0b2b85df74199575eabee3abfd7734bd36df76 (patch) | |
tree | 8030e6a2539347ccb12f0a6bbd31a1f390c6a7b7 /Timeline/ClientApp/src/app/data/common.ts | |
parent | 5d71f96cb7673815d80d0a4eb09a3cc96c564a18 (diff) | |
download | timeline-6f0b2b85df74199575eabee3abfd7734bd36df76.tar.gz timeline-6f0b2b85df74199575eabee3abfd7734bd36df76.tar.bz2 timeline-6f0b2b85df74199575eabee3abfd7734bd36df76.zip |
Move front end to a submodule.
Diffstat (limited to 'Timeline/ClientApp/src/app/data/common.ts')
-rw-r--r-- | Timeline/ClientApp/src/app/data/common.ts | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/Timeline/ClientApp/src/app/data/common.ts b/Timeline/ClientApp/src/app/data/common.ts deleted file mode 100644 index 1cdf93f1..00000000 --- a/Timeline/ClientApp/src/app/data/common.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { AxiosError } from 'axios'; - -export function extractStatusCode(error: AxiosError): number | null { - const code = error.response && error.response.status; - if (typeof code === 'number') { - return code; - } else { - return null; - } -} - -export interface CommonErrorResponse { - code: number; - message: string; -} - -export function extractErrorCode(error: AxiosError): number | null { - const { response } = error as AxiosError<CommonErrorResponse>; - const code = response && response.data && response.data.code; - if (typeof code === 'number') { - return code; - } else { - return null; - } -} |