MCPcopy
hub / github.com/redpanda-data/console / editQuery

Function editQuery

frontend/src/utils/query-helper.ts:82–106  ·  view source on GitHub ↗
(editFunction: (queryObject: Record<string, string | null | undefined>) => void)

Source from the content-addressed store, hash-verified

80 * });
81 */
82export function editQuery(editFunction: (queryObject: Record<string, string | null | undefined>) => void) {
83 try {
84 const location = appGlobal.historyLocation();
85 if (!location) {
86 // biome-ignore lint/suspicious/noConsole: intentional console usage
87 console.warn('Location not available yet, skipping query update');
88 return;
89 }
90
91 // TanStack Router uses searchStr for the raw search string
92 const searchStr = location.searchStr ?? '';
93 const currentObj = queryToObj(searchStr);
94 editFunction(currentObj);
95
96 const newQuery = objToQuery(currentObj);
97
98 if (searchStr !== newQuery) {
99 const path = location.pathname;
100 appGlobal.historyReplace(`${path}${newQuery}`);
101 }
102 } catch (error) {
103 // biome-ignore lint/suspicious/noConsole: intentional console usage
104 console.warn('Failed to update query:', error);
105 }
106}

Callers

nothing calls this directly

Calls 4

queryToObjFunction · 0.85
objToQueryFunction · 0.85
historyLocationMethod · 0.80
historyReplaceMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…