Add test notification endpoint and UI button

- Add POST /api/test-notification endpoint to send test to saved config URL
- Refactor send_notification to return Result instead of bool
- Add NotificationError enum for proper error handling
- Add test notification button in config UI with explanatory text
- Button tests saved configuration URL, not input field value
This commit is contained in:
Rupert Carr
2025-12-25 00:51:50 +00:00
committed by Markus Unterwaditzer
parent 579c2c1f3f
commit d3290a2c2d
5 changed files with 142 additions and 24 deletions
+11
View File
@@ -86,3 +86,14 @@ export async function set_config(config: Config): Promise<void> {
throw new Error(error);
}
}
export async function test_notification(): Promise<void> {
const response = await fetch('/api/test-notification', {
method: 'POST',
});
if (!response.ok) {
const error = await response.text();
throw new Error(error);
}
}