Update dependencies and refactor server configuration: Upgrade @vue/cli and ESLint packages, replace moment.js with date-fns for date handling in eventController, and remove unused HTTPS server configuration in server.js. Additionally, streamline Vue.js build process by removing cache and thread loaders in vue.config.js.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
const { Event, Institution, EventPlace, ContactPerson, EventType } = require('../models');
|
||||
const { Op } = require('sequelize');
|
||||
const moment = require('moment'); // Import von Moment.js
|
||||
const { startOfDay } = require('date-fns');
|
||||
|
||||
const getAllEvents = async (req, res) => {
|
||||
try {
|
||||
@@ -28,7 +28,7 @@ const filterEvents = async (req, res) => {
|
||||
{
|
||||
date: {
|
||||
[Op.or]: [
|
||||
{ [Op.gte]: moment().startOf('day').toDate() },
|
||||
{ [Op.gte]: startOfDay(new Date()) },
|
||||
{ [Op.eq]: null }
|
||||
]
|
||||
}
|
||||
@@ -60,7 +60,7 @@ const filterEvents = async (req, res) => {
|
||||
const events = await Event.findAll({
|
||||
where: {
|
||||
alsoOnHomepage: 1,
|
||||
date: { [Op.gte]: moment().startOf('day').toDate() }
|
||||
date: { [Op.gte]: startOfDay(new Date()) }
|
||||
},
|
||||
include: [
|
||||
{ model: Institution, as: 'institution' },
|
||||
|
||||
Reference in New Issue
Block a user