fix: incosistent navigation among published and not published events, fix #428

> take into account the unconfirmed events for navigation purposes, if you are logged in as an editor or admin?
This commit is contained in:
lesion 2024-07-27 10:15:02 +02:00
parent 9b7b1f289f
commit 3b750c89ab
No known key found for this signature in database
GPG key ID: 352918250B012177

View file

@ -157,7 +157,7 @@ const eventController = {
attributes: ['id', 'slug'],
where: {
id: { [Op.not]: event.id },
is_visible: true,
...( !isAdminOrEditor && ({ is_visible: true })),
...( !res.locals.settings.collection_in_home && ({ ap_id: null }) ),
recurrent: null,
[Op.or]: [
@ -174,9 +174,9 @@ const eventController = {
const prev = await Event.findOne({
attributes: ['id', 'slug'],
where: {
is_visible: true,
id: { [Op.not]: event.id },
...( !isAdminOrEditor && ({ is_visible: true })),
...(!res.locals.settings.collection_in_home && ({ ap_id: null }) ),
id: { [Op.not]: event.id },
recurrent: null,
[Op.or]: [
{ start_datetime: { [Op.lt]: event.start_datetime } },