Skip to content

Commit

Permalink
chore: update stamp search about negative number
Browse files Browse the repository at this point in the history
  • Loading branch information
itttm127 authored and reinamora137 committed Jan 8, 2025
1 parent 702fddd commit cd4f2f4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion islands/stamp/StampSearch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
4 changes: 1 addition & 3 deletions server/database/stampRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down

0 comments on commit cd4f2f4

Please sign in to comment.