Added notifications for actual news
Some checks failed
Code Analysis and Production Deploy / analyze (push) Failing after 5m59s
Code Analysis and Production Deploy / deploy-production (push) Has been skipped
Code Analysis and Production Deploy / deploy-test (push) Has been skipped

This commit is contained in:
Torsten Schulz (local)
2026-06-11 09:02:58 +02:00
parent c7a306e8fa
commit da1efa5a74
7 changed files with 497 additions and 18 deletions

View File

@@ -1,5 +1,6 @@
import { verifyToken, getUserById, hasAnyRole } from '../utils/auth.js'
import { saveTermin } from '../utils/termine.js'
import { sendNewEventPush } from '../utils/push-notifications.js'
export default defineEventHandler(async (event) => {
try {
@@ -41,13 +42,17 @@ export default defineEventHandler(async (event) => {
})
}
await saveTermin({
const termin = {
datum,
uhrzeit: uhrzeit || '',
titel,
beschreibung: beschreibung || '',
kategorie: kategorie || 'Sonstiges'
})
}
await saveTermin(termin)
sendNewEventPush(termin)
.then(result => console.info('Termin-Push Ergebnis:', { titel: termin.titel, ...result }))
.catch(error => console.error('Termin-Push fehlgeschlagen:', error))
return {
success: true,