fix usage of notifyAll method
All checks were successful
Build and push image for doorman-homeassistant / docker (push) Successful in 31s
Build and push Doorman UI / API / docker (push) Successful in 1m23s
Build and push image for doorman-homeassistant / deploy-gitainer (push) Successful in 25s

This commit is contained in:
Martin Dimitrov 2024-11-25 18:24:09 -08:00
parent b0492e7d58
commit 01847281ad

View File

@ -42,7 +42,7 @@ async function notifyDiscord(context, msg, u, optionalJsonStr) {
}
async function notifyAllDiscord(context, config, msg, optionalJsonStr) {
return notifyDiscord(context, config.discordUsers.map(() => msg), config.discordUsers, config.discordUsers.map(() => optionalJsonStr).filter(Boolean));
return notifyDiscord(context, config.discordUsers.map(() => msg), config.discordUsers, config.discordUsers.map(() => optionalJsonStr || ""));
}
function doorOpenTwiml(twiml, config) {
@ -139,8 +139,7 @@ exports.handler = async function(context, event, callback) {
await notifyAllDiscord(
context,
config,
`📞 Somebody buzzed the door and it dialed through to fallback phone numbers @ Door "${config.door}"`,
undefined
`📞 Somebody buzzed the door and it dialed through to fallback phone numbers @ Door "${config.door}"`
);
resolve(twiml);
} else {