File tree Expand file tree Collapse file tree 1 file changed +32
-3
lines changed
nextjs/src/features/schemas/components Expand file tree Collapse file tree 1 file changed +32
-3
lines changed Original file line number Diff line number Diff line change @@ -251,7 +251,7 @@ const SchemaList = (props: {
251251 setLoading ( false )
252252 } )
253253 }
254- } , [ organizationId , schemaListAPIParameter , allSchemaFlag ] )
254+ } , [ organizationId ] )
255255
256256 const onSearch = ( event : ChangeEvent < HTMLInputElement > ) : void => {
257257 const inputValue = event . target . value
@@ -267,12 +267,41 @@ const SchemaList = (props: {
267267 }
268268
269269 const handleFilterChange = async ( value : string ) : Promise < void > => {
270- const isAllSchemas = value === 'all '
270+ const isAllSchemas = value === 'All schemas '
271271
272272 setSelectedValue ( value )
273273 setAllSchemaFlag ( isAllSchemas )
274274
275- setSchemaListAPIParameter ( ( prev ) => ( { ...prev , page : 1 } ) )
275+ // Reset pagination and search parameters
276+ setSchemaListAPIParameter ( {
277+ itemPerPage,
278+ page : 1 ,
279+ search : '' ,
280+ sortBy : 'id' ,
281+ sortingOrder : 'desc' ,
282+ allSearch : '' ,
283+ } )
284+
285+ setSearchValue ( '' )
286+
287+ if ( organizationId ) {
288+ setLoading ( true )
289+ try {
290+ await getSchemaList (
291+ {
292+ itemPerPage,
293+ page : 1 ,
294+ search : '' ,
295+ sortBy : 'id' ,
296+ sortingOrder : 'desc' ,
297+ allSearch : '' ,
298+ } ,
299+ isAllSchemas ,
300+ )
301+ } finally {
302+ setLoading ( false )
303+ }
304+ }
276305 }
277306
278307 const schemaSelectionCallback = ( {
You can’t perform that action at this time.
0 commit comments