From ad333c8621122f397a0caf252ae2c5d9817b5c3b Mon Sep 17 00:00:00 2001 From: Alex Cheung Date: Tue, 17 Jun 2025 01:51:14 +0800 Subject: [PATCH] update SearchCriteria save --- src/auth/utils.js | 11 +++++++++++ src/components/FiDataGrid.js | 6 ++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/auth/utils.js b/src/auth/utils.js index 8c046b0..d0283ce 100644 --- a/src/auth/utils.js +++ b/src/auth/utils.js @@ -144,4 +144,15 @@ export const getSearchCriteria = (path) =>{ return "" } } +} + +export const checkSearchCriteriaPath = (path) =>{ + if(!path.startsWith("/application") + || path === "/application/search"){ + if(!path.startsWith("/user/")){ + if(!path.startsWith("/publicNotice/")){ + return true + } + } + } } \ No newline at end of file diff --git a/src/components/FiDataGrid.js b/src/components/FiDataGrid.js index 3ae3451..a0e3517 100644 --- a/src/components/FiDataGrid.js +++ b/src/components/FiDataGrid.js @@ -6,7 +6,7 @@ import { import * as HttpUtils from "utils/HttpUtils"; import { FormattedMessage, useIntl } from "react-intl"; import { TablePagination, Typography } from '@mui/material'; -import { getSearchCriteria } from "auth/utils"; +import { getSearchCriteria, checkSearchCriteriaPath } from "auth/utils"; // ==============================|| EVENT TABLE ||============================== // @@ -147,7 +147,9 @@ export function FiDataGrid({ rows, columns, sx, autoHeight, if (_doLoad.params == null) _doLoad.params = {}; _doLoad.params.start = page * pageSize; _doLoad.params.limit = pageSize; - localStorage.setItem('searchCriteria', JSON.stringify({path:window.location.pathname,data:_doLoad.params})) + if(checkSearchCriteriaPath(window.location.pathname)){ + localStorage.setItem('searchCriteria', JSON.stringify({path:window.location.pathname,data:_doLoad.params})) + } HttpUtils.get({ url: _doLoad.url,