From 3aa87cc26fd58836b82c067b58a47e08e30a7784 Mon Sep 17 00:00:00 2001 From: crupest Date: Thu, 4 Jun 2020 00:18:50 +0800 Subject: refactor(front): Make codes lint-clean! --- Timeline/ClientApp/src/data/common.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'Timeline/ClientApp/src/data/common.ts') diff --git a/Timeline/ClientApp/src/data/common.ts b/Timeline/ClientApp/src/data/common.ts index 61db8bd2..e2882a80 100644 --- a/Timeline/ClientApp/src/data/common.ts +++ b/Timeline/ClientApp/src/data/common.ts @@ -9,9 +9,14 @@ export function extractStatusCode(error: AxiosError): number | null { } } +export interface CommonErrorResponse { + code: number; + message: string; +} + export function extractErrorCode(error: AxiosError): number | null { - const code = - error.response && error.response.data && error.response.data.code; + const { response } = error as AxiosError; + const code = response && response.data && response.data.code; if (typeof code === 'number') { return code; } else { -- cgit v1.2.3