@@ -14,7 +14,6 @@ import {
14
14
toPageError
15
15
} from "@app/pages" ;
16
16
import { CreateArtifactModal , CreateGroupModal , InvalidContentModal , RootPageHeader } from "@app/components" ;
17
- import { ApiError } from "@models/apiError.model.ts" ;
18
17
import { If , ListWithToolbar , PleaseWaitModal , ProgressModal } from "@apicurio/common-ui-components" ;
19
18
import { useGroupsService } from "@services/useGroupsService.ts" ;
20
19
import { AppNavigation , useAppNavigation } from "@services/useAppNavigation.ts" ;
@@ -25,7 +24,12 @@ import { Paging } from "@models/paging.model.ts";
25
24
import { FilterBy , SearchFilter , useSearchService } from "@services/useSearchService.ts" ;
26
25
import {
27
26
ArtifactSearchResults ,
28
- ArtifactSortByObject , CreateArtifact , CreateGroup , GroupSearchResults , GroupSortByObject ,
27
+ ArtifactSortByObject ,
28
+ CreateArtifact ,
29
+ CreateGroup ,
30
+ GroupSearchResults ,
31
+ GroupSortByObject ,
32
+ RuleViolationProblemDetails ,
29
33
SortOrder ,
30
34
SortOrderObject
31
35
} from "@sdk/lib/generated-client/models" ;
@@ -69,7 +73,7 @@ export const ExplorePage: FunctionComponent<ExplorePageProps> = () => {
69
73
const [ isImporting , setImporting ] = useState ( false ) ;
70
74
const [ paging , setPaging ] = useState < Paging > ( DEFAULT_PAGING ) ;
71
75
const [ results , setResults ] = useState < ArtifactSearchResults | GroupSearchResults > ( EMPTY_RESULTS ) ;
72
- const [ invalidContentError , setInvalidContentError ] = useState < ApiError > ( ) ;
76
+ const [ invalidContentError , setInvalidContentError ] = useState < RuleViolationProblemDetails > ( ) ;
73
77
const [ importProgress , setImportProgress ] = useState ( 0 ) ;
74
78
75
79
const appNavigation : AppNavigation = useAppNavigation ( ) ;
@@ -155,7 +159,7 @@ export const ExplorePage: FunctionComponent<ExplorePageProps> = () => {
155
159
appNavigation . navigateTo ( artifactLocation ) ;
156
160
} ) . catch ( error => {
157
161
pleaseWait ( false ) ;
158
- if ( error && ( error . error_code === 400 || error . error_code === 409 ) ) {
162
+ if ( error && ( error . status === 400 || error . status === 409 ) ) {
159
163
handleInvalidContentError ( error ) ;
160
164
} else {
161
165
setPageError ( toPageError ( error , "Error creating artifact." ) ) ;
@@ -175,7 +179,7 @@ export const ExplorePage: FunctionComponent<ExplorePageProps> = () => {
175
179
appNavigation . navigateTo ( groupLocation ) ;
176
180
} ) . catch ( error => {
177
181
pleaseWait ( false ) ;
178
- if ( error && ( error . error_code === 400 || error . error_code === 409 ) ) {
182
+ if ( error && ( error . status === 400 || error . status === 409 ) ) {
179
183
handleInvalidContentError ( error ) ;
180
184
} else {
181
185
setPageError ( toPageError ( error , "Error creating group." ) ) ;
0 commit comments