Füge Ablaufdatum zu Kontaktpersonen hinzu: Implementiere die Möglichkeit, ein Ablaufdatum für Kontaktpersonen zu speichern und anzuzeigen. Aktualisiere die Filterlogik, um nur nicht abgelaufene Kontaktpersonen anzuzeigen, und passe die Benutzeroberfläche an, um das Ablaufdatum darzustellen.
This commit is contained in:
@@ -3,7 +3,16 @@ const { Op } = require('sequelize');
|
||||
|
||||
const getAllContactPersons = async (req, res) => {
|
||||
try {
|
||||
const today = new Date();
|
||||
today.setHours(0, 0, 0, 0);
|
||||
|
||||
const contactPersons = await ContactPerson.findAll({
|
||||
where: {
|
||||
[Op.or]: [
|
||||
{ expiryDate: null },
|
||||
{ expiryDate: { [Op.gte]: today } }
|
||||
]
|
||||
},
|
||||
include: [
|
||||
{
|
||||
model: Position,
|
||||
@@ -79,6 +88,14 @@ const filterContactPersons = async (req, res) => {
|
||||
const where = {};
|
||||
const having = [];
|
||||
|
||||
// Filter für nicht abgelaufene Kontaktpersonen
|
||||
const today = new Date();
|
||||
today.setHours(0, 0, 0, 0);
|
||||
where[Op.or] = [
|
||||
{ expiryDate: null },
|
||||
{ expiryDate: { [Op.gte]: today } }
|
||||
];
|
||||
|
||||
if (config.selection.id && config.selection.id === 'all') {
|
||||
// No additional filter needed for "all"
|
||||
} else if (config.selection.id) {
|
||||
|
||||
Reference in New Issue
Block a user