Skip to content

Commit

Permalink
last fix: invert slice and sort
Browse files Browse the repository at this point in the history
  • Loading branch information
c2d13p committed Dec 12, 2024
1 parent 0436b2c commit afe18d6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions widgets/src/components/HomeGrantList.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ export function HomeGrantList({ default_entries = 3 }) {
};

const all_grant_list = data
.slice(0, numberOfEntries)
.sort((a, b) => {
const amountA = parseBudgetAmount(a.budgetAmount)
const amountB = parseBudgetAmount(b.budgetAmount)
return amountB - amountA;
const amountA = parseBudgetAmount(a.budgetAmount)
const amountB = parseBudgetAmount(b.budgetAmount)
return amountB - amountA;
})
.slice(0, numberOfEntries)
.map((x) => (
<GrantBox grant={x} key={x._id}></GrantBox>
));
Expand Down

0 comments on commit afe18d6

Please sign in to comment.