|
@@ -250,6 +250,16 @@ const getData = () => {
|
|
);
|
|
);
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+const validQueryKeys = [
|
|
|
|
+ "page",
|
|
|
|
+ "pageSize",
|
|
|
|
+ "filter",
|
|
|
|
+ "columnSort",
|
|
|
|
+ "columnOrder",
|
|
|
|
+ "columnWidths",
|
|
|
|
+ "shownColumns"
|
|
|
|
+];
|
|
|
|
+
|
|
const setQuery = () => {
|
|
const setQuery = () => {
|
|
const queryObject = {
|
|
const queryObject = {
|
|
...route.query,
|
|
...route.query,
|
|
@@ -272,6 +282,16 @@ const setQuery = () => {
|
|
shownColumns: JSON.stringify(shownColumns.value)
|
|
shownColumns: JSON.stringify(shownColumns.value)
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+ const invalidKeys = Object.keys(queryObject).filter(
|
|
|
|
+ key => !validQueryKeys.includes(key)
|
|
|
|
+ );
|
|
|
|
+ invalidKeys.forEach(invalidKey => {
|
|
|
|
+ console.log(
|
|
|
|
+ `Removing query key ${invalidKey} with value ${queryObject[invalidKey]}.`
|
|
|
|
+ );
|
|
|
|
+ delete queryObject[invalidKey];
|
|
|
|
+ });
|
|
|
|
+
|
|
const queryString = `?${Object.keys(queryObject)
|
|
const queryString = `?${Object.keys(queryObject)
|
|
.map(key => `${key}=${queryObject[key]}`)
|
|
.map(key => `${key}=${queryObject[key]}`)
|
|
.join("&")}`;
|
|
.join("&")}`;
|