mirror of
https://github.com/nicotsx/ironmount.git
synced 2025-12-10 12:10:51 +01:00
* refactor: use short ids to allow changing the name of volumes & repos * refactor: address PR feedbacks * fix: make short_id non null after initial population
23 lines
592 B
TypeScript
23 lines
592 B
TypeScript
import type { NotificationConfig } from "~/schemas/notifications";
|
|
|
|
export function buildPushoverShoutrrrUrl(config: Extract<NotificationConfig, { type: "pushover" }>): string {
|
|
const params = new URLSearchParams();
|
|
|
|
if (config.devices) {
|
|
params.append("devices", config.devices);
|
|
}
|
|
|
|
if (config.priority !== undefined) {
|
|
params.append("priority", config.priority.toString());
|
|
}
|
|
|
|
const queryString = params.toString();
|
|
let shoutrrrUrl = `pushover://shoutrrr:${config.apiToken}@${config.userKey}/`;
|
|
|
|
if (queryString) {
|
|
shoutrrrUrl += `?${queryString}`;
|
|
}
|
|
|
|
return shoutrrrUrl;
|
|
}
|