Geburtsdatum fix
This commit is contained in:
parent
9a75483fa7
commit
66e0569912
5
app.js
5
app.js
|
@ -534,7 +534,6 @@ app.get('/training', requireAuth, async (req, res) => {
|
||||||
selectedKW = moment(selectedDate).isoWeek();
|
selectedKW = moment(selectedDate).isoWeek();
|
||||||
selectetYear = moment(selectedDate).year();
|
selectetYear = moment(selectedDate).year();
|
||||||
}
|
}
|
||||||
console.log(selectedKW + ' ' + selectetYear);
|
|
||||||
const training = await getTraining(selectedDate);
|
const training = await getTraining(selectedDate);
|
||||||
|
|
||||||
const trainingsResult = await pool.query('SELECT datum FROM trainings ORDER BY datum ASC');
|
const trainingsResult = await pool.query('SELECT datum FROM trainings ORDER BY datum ASC');
|
||||||
|
@ -704,7 +703,7 @@ app.post('/set-riege', requireAuth, async (req, res) => {
|
||||||
})
|
})
|
||||||
|
|
||||||
app.post('/update-mitglied', requireAdmin, async (req, res) => {
|
app.post('/update-mitglied', requireAdmin, async (req, res) => {
|
||||||
const { type, id, telid, adresse, name, verbindung, nummer } = req.body;
|
const { type, id, geburt, telid, adresse, name, verbindung, nummer } = req.body;
|
||||||
try {
|
try {
|
||||||
if (type == "tel") {
|
if (type == "tel") {
|
||||||
console.log('INSERT INTO telefonnummern (fid_teilnehmer, name, verbindung, nummer, stand) VALUES ($1, $2, $3, $4, $5)', [id, name, verbindung, nummer, moment().toDate()]);
|
console.log('INSERT INTO telefonnummern (fid_teilnehmer, name, verbindung, nummer, stand) VALUES ($1, $2, $3, $4, $5)', [id, name, verbindung, nummer, moment().toDate()]);
|
||||||
|
@ -713,7 +712,7 @@ app.post('/update-mitglied', requireAdmin, async (req, res) => {
|
||||||
await pool.query('DELETE FROM telefonnummern WHERE id = $1', [telid]);
|
await pool.query('DELETE FROM telefonnummern WHERE id = $1', [telid]);
|
||||||
console.log('delete numer $1', [telid]);
|
console.log('delete numer $1', [telid]);
|
||||||
} else if (type == "adresse") {
|
} else if (type == "adresse") {
|
||||||
await pool.query('UPDATE teilnehmende SET adresse = $1 WHERE id = $2', [adresse, id]);
|
await pool.query('UPDATE teilnehmende SET geburtsdatum = $1, adresse = $2 WHERE id = $3', [geburt, adresse, id]);
|
||||||
}
|
}
|
||||||
|
|
||||||
res.redirect('/mitglied/' + id);
|
res.redirect('/mitglied/' + id);
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue