diff --git a/src/pages/api/inventory.ts b/src/pages/api/inventory.ts index b48e1f0..ee0d6a4 100644 --- a/src/pages/api/inventory.ts +++ b/src/pages/api/inventory.ts @@ -5,11 +5,11 @@ import { client } from '../../db/typesense'; import { eq } from 'drizzle-orm'; const GainLoss = (purchasePrice: any, marketPrice: any) => { - if (!purchasePrice || !marketPrice) return '
N/A
'; + if (!purchasePrice || !marketPrice) return '
N/A
'; const pp = Number(purchasePrice); const mp = Number(marketPrice); - if (pp === mp) return '
-
'; - if (pp > mp) return `
-$${(pp - mp).toFixed(2)}
`; + if (pp === mp) return '
-
'; + if (pp > mp) return `
-$${(pp - mp).toFixed(2)}
`; return `
+$${(mp - pp).toFixed(2)}
`; } const DollarToInt = (dollar: any) => { @@ -71,7 +71,7 @@ const getInventory = async (userId: string, cardId: number) => {
- +