mirror of
https://github.com/strapi/strapi.git
synced 2025-12-29 08:04:51 +00:00
Fix PR feedback
Signed-off-by: soupette <cyril@strapi.io>
This commit is contained in:
parent
391d2facde
commit
b48945ce1d
@ -23,12 +23,12 @@ const useModalQueryParams = () => {
|
||||
|
||||
const handleChangeSearch = _q => {
|
||||
if (_q) {
|
||||
setQueryObject(prev => ({ ...prev, _q }));
|
||||
setQueryObject(prev => ({ ...prev, _q, page: 1 }));
|
||||
} else {
|
||||
const newState = {};
|
||||
const newState = { page: 1 };
|
||||
|
||||
Object.keys(queryObject).forEach(key => {
|
||||
if (key !== '_q') {
|
||||
if (!['page', '_q'].includes(key)) {
|
||||
newState[key] = queryObject[key];
|
||||
}
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user