From 74507cbd5c58b3f0a038a3d7cdbc8411dfbeee02 Mon Sep 17 00:00:00 2001 From: MartinSchuhmacher Date: Tue, 21 Nov 2023 07:07:15 +0100 Subject: [PATCH] adjust to new repo behaviour for newest release --- controllers/dashboard.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/controllers/dashboard.js b/controllers/dashboard.js index 5892c76eae..b04039d5fa 100644 --- a/controllers/dashboard.js +++ b/controllers/dashboard.js @@ -230,7 +230,7 @@ router.get('/', (req, res, next) => { qs: { $limit: 1, $sort: { - createdAt: -1, + publishedAt: -1, }, }, }) @@ -262,7 +262,7 @@ router.get('/', (req, res, next) => { const newestRelease = newestReleases[0] || {}; const newRelease = !!( Date.parse(userPreferences.releaseDate) - < Date.parse(newestRelease.createdAt) + < Date.parse(newestRelease.publishedAt) ); const roles = user.roles.map((role) => role.name); let homeworksFeedbackRequired = []; @@ -278,7 +278,7 @@ router.get('/', (req, res, next) => { if (newRelease || !userPreferences.releaseDate) { api(req) .patch(`/users/${user._id}`, { - json: { 'preferences.releaseDate': newestRelease.createdAt }, + json: { 'preferences.releaseDate': newestRelease.publishedAt }, }) .catch(() => { warn('failed to update user preference releaseDate');