From cd4f2f4875fdc1c86d721d6c2e66059211ebdad4 Mon Sep 17 00:00:00 2001 From: itttm127 Date: Wed, 8 Jan 2025 08:30:21 +0900 Subject: [PATCH] chore: update stamp search about negative number --- islands/stamp/StampSearch.tsx | 2 +- server/database/stampRepository.ts | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/islands/stamp/StampSearch.tsx b/islands/stamp/StampSearch.tsx index 3d4920d87..67cc3023d 100644 --- a/islands/stamp/StampSearch.tsx +++ b/islands/stamp/StampSearch.tsx @@ -151,7 +151,7 @@ export function StampSearchClient( } // Check for stamp number - if (/^\d+$/.test(query)) { + if (/^[-]?\d+$/.test(query)) { try { const response = await fetch(`/api/v2/stamps/${query}?q=search`); const responseData = await response.json(); diff --git a/server/database/stampRepository.ts b/server/database/stampRepository.ts index 6578a7c8a..33b763e61 100644 --- a/server/database/stampRepository.ts +++ b/server/database/stampRepository.ts @@ -117,9 +117,7 @@ export class StampRepository { if (type === "cursed") { stampCondition = "st.stamp < 0"; } else if (type === "stamps") { - if (isSearchQuery) - stampCondition = "st.stamp >= 0"; - else + if (!isSearchQuery) stampCondition = "st.stamp >= 0 AND st.ident != 'SRC-20'"; } else if (type === "posh") { stampCondition =