From d0d9377941874093052fec514664b62c6fef81ec Mon Sep 17 00:00:00 2001 From: MaXCoX610 <154246298+Dan-works-on-stuff@users.noreply.github.com> Date: Fri, 20 Jun 2025 12:14:39 +0300 Subject: [PATCH 1/4] fixed RON instead of dollars for overlay --- src/components/WishlistView.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/WishlistView.tsx b/src/components/WishlistView.tsx index 69b534d..5a7d2cd 100644 --- a/src/components/WishlistView.tsx +++ b/src/components/WishlistView.tsx @@ -318,7 +318,7 @@ const Wishlist: React.FC = ({ >
- ${item.contribution.current} of $ + RON{item.contribution.current} of RON {item.contribution.total}
From af51f3169d52431a605626b72280a59747341fe1 Mon Sep 17 00:00:00 2001 From: MaXCoX610 <154246298+Dan-works-on-stuff@users.noreply.github.com> Date: Fri, 20 Jun 2025 13:10:52 +0300 Subject: [PATCH 2/4] fixed RON instead of dollars for EVERYTHINGGGGG --- src/pages/api/item-create.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/pages/api/item-create.ts b/src/pages/api/item-create.ts index 62878e6..4a9e910 100644 --- a/src/pages/api/item-create.ts +++ b/src/pages/api/item-create.ts @@ -34,7 +34,16 @@ export default async function handler( description: description, imagesUrl: photo, imagesKey: key, - price: stripCurrency(price), + price: (() => { + if (typeof price === "string" && price.trim().endsWith("USD")) { + const numericPart = price.trim().slice(0, -3).trim(); + const value = parseFloat(numericPart); + if (!isNaN(value)) { + return value * 4.4; + } + } + return stripCurrency(price); + })(), retailerId: retailer, }, }); From 093deeb286399f9992e53776073fbb9a89608d60 Mon Sep 17 00:00:00 2001 From: P Date: Sun, 22 Jun 2025 16:31:02 +0300 Subject: [PATCH 3/4] price in ron --- src/components/CustomWishlistModal.tsx | 4 ++-- src/pages/api/item-create.ts | 23 ++++++++++++++--------- src/pages/wishlist-create.tsx | 1 - 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/src/components/CustomWishlistModal.tsx b/src/components/CustomWishlistModal.tsx index c18f150..bf21a1c 100644 --- a/src/components/CustomWishlistModal.tsx +++ b/src/components/CustomWishlistModal.tsx @@ -118,10 +118,10 @@ export default function CustomWishlistModal({ /> setPrice(String(e.target.value))} diff --git a/src/pages/api/item-create.ts b/src/pages/api/item-create.ts index 4a9e910..28ae201 100644 --- a/src/pages/api/item-create.ts +++ b/src/pages/api/item-create.ts @@ -35,15 +35,20 @@ export default async function handler( imagesUrl: photo, imagesKey: key, price: (() => { - if (typeof price === "string" && price.trim().endsWith("USD")) { - const numericPart = price.trim().slice(0, -3).trim(); - const value = parseFloat(numericPart); - if (!isNaN(value)) { - return value * 4.4; - } - } - return stripCurrency(price); - })(), + if (null === price) { + return null; + } + + if (typeof price === "string" && price.trim().endsWith("USD")) { + const numericPart = price.trim().slice(0, -3).trim(); + const value = parseFloat(numericPart); + if (!isNaN(value)) { + return value * 4.4; + } + } + + return Number(stripCurrency(price)); + })(), retailerId: retailer, }, }); diff --git a/src/pages/wishlist-create.tsx b/src/pages/wishlist-create.tsx index 51855db..c0e9f9d 100644 --- a/src/pages/wishlist-create.tsx +++ b/src/pages/wishlist-create.tsx @@ -18,7 +18,6 @@ import styles from "../styles/WishlistPage.module.css"; import buttonStyles from "../styles/Button.module.css"; import loadingStyles from "../styles/wishlistcomponent.module.css"; import "./../styles/globals.css"; -import ebayLogo from "./../../public/illustrations/ebay-logo.png"; type ItemCreateResponse = { itemId: number; From ffc6ec3d0b6b43d462bb7c201a45899de8d7b551 Mon Sep 17 00:00:00 2001 From: P Date: Sun, 22 Jun 2025 16:35:57 +0300 Subject: [PATCH 4/4] small test fix for custom items --- src/__tests__/CustomWishlistModal.test.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/__tests__/CustomWishlistModal.test.tsx b/src/__tests__/CustomWishlistModal.test.tsx index 94132dd..600e820 100644 --- a/src/__tests__/CustomWishlistModal.test.tsx +++ b/src/__tests__/CustomWishlistModal.test.tsx @@ -25,7 +25,7 @@ describe("CustomWishlistModal", () => { expect(screen.getByLabelText(/Add the name/i)).toBeInTheDocument(); expect(screen.getByLabelText(/Add the description/i)).toBeInTheDocument(); - expect(screen.getByLabelText(/Price:/i)).toBeInTheDocument(); + expect(screen.getByLabelText(/Price \(RON\):/i)).toBeInTheDocument(); expect(screen.getByLabelText(/Add a note/i)).toBeInTheDocument(); expect(screen.getByLabelText(/Quantity:/i)).toBeInTheDocument(); expect(screen.getByLabelText(/Priority:/i)).toBeInTheDocument(); @@ -55,7 +55,7 @@ describe("CustomWishlistModal", () => { target: { value: "A useful item" }, }); - fireEvent.change(screen.getByLabelText(/Price:/i), { + fireEvent.change(screen.getByLabelText(/Price \(RON\):/i), { target: { value: "49.99" }, });