removed sort function which is now done by backend

main
alex 2024-06-11 22:19:37 +02:00
parent f623637b2f
commit bf0bfc693e
1 changed files with 3 additions and 2 deletions

View File

@ -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