mirror of
https://github.com/EFForg/rayhunter.git
synced 2026-07-21 07:08:10 -07:00
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:
committed by
Markus Unterwaditzer
parent
579c2c1f3f
commit
d3290a2c2d
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user