Skip to content

Commit 6c5a948

Browse files
Update app/dfda/components/VariableSearchAutocomplete.tsx
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
1 parent 18bcd4c commit 6c5a948

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

app/dfda/components/VariableSearchAutocomplete.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,12 @@ export default function VariableSearchAutocomplete({
8080
setIsLoading(true)
8181
try {
8282
// Create a cache key based on search term and params
83-
const cacheKey = `dfda-variable-search:${searchTerm}:${JSON.stringify(searchParams)}`
84-
83+
const cacheKey = `dfda-variable-search:${searchTerm}:${
84+
JSON.stringify(Object.keys(searchParams).sort().reduce((obj, key) => {
85+
obj[key] = searchParams[key]
86+
return obj
87+
}, {}))
88+
}`
8589
// Check cache first
8690
const cachedResults = getCachedResults(cacheKey)
8791
if (cachedResults) {

0 commit comments

Comments
 (0)