Oprava pádu při chybějící konfiguraci Gotify
This commit is contained in:
parent
09264720d1
commit
89fc27b087
@ -10,7 +10,10 @@ dotenv.config({ path: path.resolve(__dirname, `../.env.${ENVIRONMENT}`) });
|
||||
const gotifyDataRaw = process.env.GOTIFY_SERVERS_AND_KEYS || "{}";
|
||||
const gotifyData: GotifyServer[] = JSON.parse(gotifyDataRaw);
|
||||
|
||||
export const gotifyCall = async (data: NotififaceInput, gotifyServers: GotifyServer[]): Promise<any[]> => {
|
||||
export const gotifyCall = async (data: NotififaceInput, gotifyServers?: GotifyServer[]): Promise<any[]> => {
|
||||
if (!Array.isArray(gotifyServers)) {
|
||||
return []
|
||||
}
|
||||
const urls = gotifyServers.flatMap(gotifyServer =>
|
||||
gotifyServer.api_keys.map(apiKey => `${gotifyServer.server}/message?token=${apiKey}`));
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user