Skip to content

Commit 8d2e8f9

Browse files
author
John Rogers
committed
Remove optional parameters from fetchResultsByUuids batch lookup - only pass UUIDs for consistency
1 parent 606d290 commit 8d2e8f9

2 files changed

Lines changed: 4 additions & 27 deletions

File tree

.cursor-updates

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,5 @@
7171
- Removed duplicate request prevention that was blocking legitimate DataGrid requests
7272
- Fixed 'No results' message flashing during search - now only shows after search actually completes (loading goes from true to false), preventing false "0 results" display while search is in progress
7373
- Fixed variables table hiding logic - now correctly hides when get_variables returns no results on first page, regardless of whether there's a search query
74-
- Replaced /items/[slug] with catch-all route /items/[[...slug]] that pre-generates and pre-renders all item routes (by slug and UUID, 21k+ routes) with data at build time, just like studies pages - fetches from cache/API during build and passes to component, fetchResultByUuid handles both slugs and UUIDs
74+
- Replaced /items/[slug] with catch-all route /items/[[...slug]] that pre-generates and pre-renders all item routes (by slug and UUID, 21k+ routes) with data at build time, just like studies pages - fetches from cache/API during build and passes to component, fetchResultByUuid handles both slugs and UUIDs
75+
- Removed all optional parameters (query, alpha, maxVectorDistance, maxDistanceMode) from fetchResultByUuid lookup endpoint - now only passes uuid or slug to improve API performance

src/services/api.ts

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -561,40 +561,16 @@ export async function fetchSearchResults(
561561
}
562562

563563
export async function fetchResultsByUuids(
564-
uuids: string[],
565-
query?: string,
566-
alpha?: number,
567-
maxVectorDistance?: number,
568-
maxDistanceMode: "max_distance" | "min_score" | "both" = "min_score"
564+
uuids: string[]
569565
): Promise<SearchResult[]> {
570566
console.log(`🔗 API CALL: fetchResultsByUuids(${uuids.length} UUIDs)`);
571567
const params = new URLSearchParams();
572568

573-
// Append all UUIDs
569+
// Append all UUIDs - only pass UUIDs, no other parameters
574570
for (const uuid of uuids) {
575571
params.append("uuid", uuid);
576572
}
577573

578-
// Append query parameter if provided
579-
if (query && query.trim()) {
580-
params.set("query", query.trim());
581-
}
582-
583-
// Append alpha parameter if provided
584-
if (alpha !== undefined) {
585-
params.set("alpha", alpha.toString());
586-
}
587-
588-
// Add max_vector_distance and/or min_original_vector_score based on mode
589-
// Always send these parameters (use default 0.4 if not provided)
590-
const distanceValue = maxVectorDistance !== undefined ? maxVectorDistance : 0.4;
591-
if (maxDistanceMode === "max_distance" || maxDistanceMode === "both") {
592-
params.set("max_vector_distance", distanceValue.toString());
593-
}
594-
if (maxDistanceMode === "min_score" || maxDistanceMode === "both") {
595-
params.set("min_original_vector_score", (1 - distanceValue).toString());
596-
}
597-
598574
const url = `${API_BASE}/discover/lookup?${params.toString()}`;
599575
const response = await fetch(url);
600576

0 commit comments

Comments
 (0)