From 5fb883e279b928fb942bd530e5b3163ecf0cae6a Mon Sep 17 00:00:00 2001 From: Erik Ritter Date: Thu, 30 Apr 2020 17:03:31 -0700 Subject: [PATCH] chore(ts): type getClientErrorObject (#9693) --- ...t_spec.js => getClientErrorObject_spec.ts} | 0 superset-frontend/src/setup/setupApp.ts | 8 +- .../src/utils/getClientErrorObject.js | 74 --------------- .../src/utils/getClientErrorObject.ts | 90 +++++++++++++++++++ 4 files changed, 95 insertions(+), 77 deletions(-) rename superset-frontend/spec/javascripts/utils/{getClientErrorObject_spec.js => getClientErrorObject_spec.ts} (100%) delete mode 100644 superset-frontend/src/utils/getClientErrorObject.js create mode 100644 superset-frontend/src/utils/getClientErrorObject.ts diff --git a/superset-frontend/spec/javascripts/utils/getClientErrorObject_spec.js b/superset-frontend/spec/javascripts/utils/getClientErrorObject_spec.ts similarity index 100% rename from superset-frontend/spec/javascripts/utils/getClientErrorObject_spec.js rename to superset-frontend/spec/javascripts/utils/getClientErrorObject_spec.ts diff --git a/superset-frontend/src/setup/setupApp.ts b/superset-frontend/src/setup/setupApp.ts index e81c6d2ba..b4a9ca7ef 100644 --- a/superset-frontend/src/setup/setupApp.ts +++ b/superset-frontend/src/setup/setupApp.ts @@ -19,10 +19,12 @@ /* eslint global-require: 0 */ import $ from 'jquery'; import { SupersetClient } from '@superset-ui/connection'; -import getClientErrorObject from '../utils/getClientErrorObject'; +import getClientErrorObject, { + ClientErrorObject, +} from '../utils/getClientErrorObject'; import setupErrorMessages from './setupErrorMessages'; -function showApiMessage(resp: { severity?: string; message: string }) { +function showApiMessage(resp: ClientErrorObject) { const template = '
' + '