removed sort function which is now done by backend
parent
f623637b2f
commit
bf0bfc693e
|
@ -126,6 +126,7 @@ function VoteRequest(id, up) {
|
|||
}
|
||||
|
||||
// Create a function to compare date values
|
||||
/*
|
||||
function comparePublishedAt(a, b) {
|
||||
// Check if PublishedAt for both a and b is empty
|
||||
if (!a.PublishedAt && !b.PublishedAt) {
|
||||
|
@ -150,7 +151,7 @@ function comparePublishedAt(a, b) {
|
|||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
} */
|
||||
|
||||
function dateDiffInDays(a, b) {
|
||||
const diffInMs = Math.abs(b - a);
|
||||
|
@ -228,7 +229,7 @@ function App() {
|
|||
<Result status={404} title="Aktuell nichts neues :(" />
|
||||
) : products.NewProducts.length > 0 ? (
|
||||
<>
|
||||
{products.NewProducts.sort(comparePublishedAt).map(
|
||||
{products.NewProducts /*.sort(comparePublishedAt) */.map(
|
||||
(product, index) =>
|
||||
(showMore.newProducts || index < 5) && (
|
||||
<Card
|
||||
|
|
Loading…
Reference in New Issue