From dbd0fd197323f2a83fab384d7b4b116a02165d16 Mon Sep 17 00:00:00 2001
From: xuatz <xzlow10@gmail.com>
Date: Sun, 18 May 2025 17:21:11 +0900
Subject: fix(search): add new relevance sort order (#1392)

* fix(search): add new relevance sort order

* address pr comments

* some minor fixes

---------

Co-authored-by: Mohamed Bassem <me@mbassem.com>
---
 apps/web/components/dashboard/bookmarks/UpdatableBookmarksGrid.tsx | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

(limited to 'apps/web/components/dashboard/bookmarks/UpdatableBookmarksGrid.tsx')

diff --git a/apps/web/components/dashboard/bookmarks/UpdatableBookmarksGrid.tsx b/apps/web/components/dashboard/bookmarks/UpdatableBookmarksGrid.tsx
index da65b9d9..968d0326 100644
--- a/apps/web/components/dashboard/bookmarks/UpdatableBookmarksGrid.tsx
+++ b/apps/web/components/dashboard/bookmarks/UpdatableBookmarksGrid.tsx
@@ -23,7 +23,11 @@ export default function UpdatableBookmarksGrid({
   showEditorCard?: boolean;
   itemsPerPage?: number;
 }) {
-  const sortOrder = useSortOrderStore((state) => state.sortOrder);
+  let sortOrder = useSortOrderStore((state) => state.sortOrder);
+  if (sortOrder === "relevance") {
+    // Relevance is not supported in the `getBookmarks` endpoint.
+    sortOrder = "desc";
+  }
 
   const finalQuery = { ...query, sortOrder, includeContent: false };
 
-- 
cgit v1.2.3-70-g09d2

