File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -83,7 +83,8 @@ export const Tenants = ({additionalTenantsProps}: TenantsProps) => {
8383 } ;
8484
8585 const handleSearchChange = ( value : string ) => {
86- dispatch ( setSearchValue ( value ) ) ;
86+ // Do not add empty string to store
87+ dispatch ( setSearchValue ( value || undefined ) ) ;
8788 } ;
8889
8990 const renderCreateDBButton = ( ) => {
Original file line number Diff line number Diff line change @@ -6,13 +6,13 @@ import {api} from '../api';
66import type { PreparedTenant , TenantsState } from './types' ;
77import { prepareTenants } from './utils' ;
88
9- const initialState : TenantsState = { searchValue : '' } ;
9+ const initialState : TenantsState = { } ;
1010
1111const slice = createSlice ( {
1212 name : 'tenants' ,
1313 initialState,
1414 reducers : {
15- setSearchValue : ( state , action : PayloadAction < string > ) => {
15+ setSearchValue : ( state , action : PayloadAction < string | undefined > ) => {
1616 state . searchValue = action . payload ;
1717 } ,
1818 } ,
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ export interface PreparedTenant extends TTenant {
1515}
1616
1717export interface TenantsState {
18- searchValue : string ;
18+ searchValue ? : string ;
1919}
2020
2121export interface TenantsStateSlice {
You can’t perform that action at this time.
0 commit comments