11import { useReducer } from 'react' ;
22import { useIntl } from '@edx/frontend-platform/i18n' ;
33
4- import { useCreateTag , useUpdateTag } from '../data/apiHooks' ;
4+ import globalMessages from '@src/messages' ;
5+ import { useCreateTag , useUpdateTag } from '@src/taxonomy/data/apiHooks' ;
6+ import type { RowId } from '@src/taxonomy/tree-table/types' ;
57import { TagTree } from './tagTree' ;
68import { TagListTableError } from './errors' ;
7- import type { RowId } from '../tree-table/types' ;
89import {
910 TABLE_MODES ,
1011 TRANSITION_TABLE ,
@@ -13,8 +14,6 @@ import {
1314} from './constants' ;
1415
1516import messages from './messages' ;
16- import globalMessages from '../../messages' ;
17- import { AxiosError } from 'axios' ;
1817
1918/** Interface for table mode actions for React's `useReducer` hook.
2019 *
@@ -165,9 +164,9 @@ const useEditActions = ({
165164 return true ;
166165 } ;
167166
168- const getErrorMessage = ( error : unknown ) : string => {
167+ const getErrorMessage = ( error : any ) : string => {
169168 let errorMessage : string = '' ;
170- if ( error instanceof AxiosError ) {
169+ if ( error . name === ' AxiosError' ) {
171170 const responseData = error . response ?. data ;
172171 const tagError = Object . entries ( responseData ) ?. find ( ( errItem : [ string , unknown ] ) => (
173172 [ 'tag' , 'value' , 'updated_tag_value' ] . includes ( errItem [ 0 ] . toLowerCase ( ) )
0 commit comments