Skip to content

Commit

Permalink
💄 Round up the potential reward
Browse files Browse the repository at this point in the history
  • Loading branch information
KONFeature committed Jan 14, 2025
1 parent 43bdc1e commit 6a35911
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ export const estimatedInteractionRewardQuery = ({
enabled: !!productId,
queryKey: [
"interactions",
"estimated-interactions-reward",
productId ?? "no-initial-product-id",
"estimated-reward",
productId ?? "no-product-id",
interaction ?? "no-key-filter",
],
async queryFn() {
Expand All @@ -35,8 +35,12 @@ export const estimatedInteractionRewardQuery = ({
});
if (error) throw error;

// Floor it so we don't have floating point issues
return data?.totalReferrerEur?.toFixed(2) ?? null;
if (!data?.totalReferrerEur) {
return null;
}

// Ceil it so we don't have floating point issues
return Math.ceil(data.totalReferrerEur).toString();
},
});

Expand Down

0 comments on commit 6a35911

Please sign in to comment.