aboutsummaryrefslogtreecommitdiff
path: root/Timeline/ClientApp/src/app/data/common.ts
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-07-13 20:59:52 +0800
committercrupest <crupest@outlook.com>2020-07-13 20:59:52 +0800
commite69190abb09661caa19fa3905a0d8f3b7e72648b (patch)
tree8030e6a2539347ccb12f0a6bbd31a1f390c6a7b7 /Timeline/ClientApp/src/app/data/common.ts
parent0a7c884be668267003d7666b444f1022c99a7148 (diff)
downloadtimeline-e69190abb09661caa19fa3905a0d8f3b7e72648b.tar.gz
timeline-e69190abb09661caa19fa3905a0d8f3b7e72648b.tar.bz2
timeline-e69190abb09661caa19fa3905a0d8f3b7e72648b.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.ts25
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;
- }
-}