refactor(search): normalize buttons to fit match other sections

This commit is contained in:
Edouard Vanbelle
2026-07-26 16:54:15 +02:00
parent 5a034d390e
commit e5fa234f3a
3 changed files with 88 additions and 23 deletions
+3
View File
@@ -25,6 +25,8 @@ export interface SearchOptions {
cursor?: string;
/** Sort dimension; maps to backend `order_by`. */
sortBy?: SortBy;
/** Reverse sort direction; maps to backend `reverse`. */
reverse?: boolean;
/** Restrict to files, folders, or both (default). */
resourceTypes?: ItemType[];
/** Abort the request when a newer search supersedes it. */
@@ -58,6 +60,7 @@ export function searchResources(
if (opts.limit != null) params.append('limit', String(opts.limit));
if (opts.cursor) params.append('cursor', opts.cursor);
if (opts.sortBy) params.append('order_by', opts.sortBy);
if (opts.reverse) params.append('reverse', 'true');
return apiJson<SearchResourcesResponse>(`/api/search?${params.toString()}`, {
credentials: 'same-origin',
signal: opts.signal