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) { 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) { function doorOpenTwiml(twiml, config) {
@ -139,8 +139,7 @@ exports.handler = async function(context, event, callback) {
await notifyAllDiscord( await notifyAllDiscord(
context, context,
config, config,
`📞 Somebody buzzed the door and it dialed through to fallback phone numbers @ Door "${config.door}"`, `📞 Somebody buzzed the door and it dialed through to fallback phone numbers @ Door "${config.door}"`
undefined
); );
resolve(twiml); resolve(twiml);
} else { } else {