[CAL-1008] Fix 'All Bookings' filter not getting selected after coming from 'Your Bookings' (#8902)
* [CAL-1008] Fix 'All Bookings' filter not getting selected after coming from 'Your Bookings' * Remove optional param from removeAllQueryParams function * Remove setQuery from the extraction --------- Co-authored-by: Joe Au-Yeung <[email protected]> Co-authored-by: alannnc <[email protected]>
This commit is contained in:
2 files changed
+18
-4
No files matched your search
@@ -86,5 +86,19 @@ export function useTypedQuery<T extends z.AnyZodObject>(schema: T) {
|
||||
}
|
||||
}
|
||||
|
||||
return { data: parsedQuery, setQuery, removeByKey, pushItemToKey, removeItemByKeyAndValue };
|
||||
// Remove all query params from the URL
|
||||
function removeAllQueryParams() {
|
||||
const { asPath } = router;
|
||||
const newPath = asPath.split("?")[0];
|
||||
router.replace(newPath, undefined, { shallow: true });
|
||||
}
|
||||
|
||||
return {
|
||||
data: parsedQuery,
|
||||
setQuery,
|
||||
removeByKey,
|
||||
pushItemToKey,
|
||||
removeItemByKeyAndValue,
|
||||
removeAllQueryParams,
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user