Skip to content

Commit afe18d6

Browse files
committed
last fix: invert slice and sort
1 parent 0436b2c commit afe18d6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

widgets/src/components/HomeGrantList.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@ export function HomeGrantList({ default_entries = 3 }) {
3939
};
4040

4141
const all_grant_list = data
42-
.slice(0, numberOfEntries)
4342
.sort((a, b) => {
44-
const amountA = parseBudgetAmount(a.budgetAmount)
45-
const amountB = parseBudgetAmount(b.budgetAmount)
46-
return amountB - amountA;
43+
const amountA = parseBudgetAmount(a.budgetAmount)
44+
const amountB = parseBudgetAmount(b.budgetAmount)
45+
return amountB - amountA;
4746
})
47+
.slice(0, numberOfEntries)
4848
.map((x) => (
4949
<GrantBox grant={x} key={x._id}></GrantBox>
5050
));

0 commit comments

Comments
 (0)