Accept 5-digit dienst numbers and normalize lookup type

This commit is contained in:
Eddy de Vink 2026-09-14 15:06:14 +02:00
commit c97d662856
3 changed files with 4 additions and 3 deletions

View file

@ -6,7 +6,7 @@ const { increment: incrementDaily } = require('./dailyStats')
const ALLOWED_GROUP = process.env.ALLOWED_GROUP
function extractDienstnummer(body) {
const match = body.match(/^\s*(\d{4})\s*$/)
const match = body.match(/^\s*(\d{4,5})\s*$/)
return match ? match[1] : null
}
@ -66,4 +66,4 @@ async function handleWebhook(payload) {
}
}
module.exports = { handleWebhook }
module.exports = { handleWebhook, extractDienstnummer }