feat(notifications): add Test button for ntfy and RSS with inline result
- POST /api/notifications/test/ntfy — sends a real push using current form values (not saved settings) so auth can be verified before saving; returns status + HTTP detail on success or error message on failure - POST /api/notifications/test/rss — confirms the feed token exists and returns event count; no bill FK required - NtfyTestRequest + NotificationTestResult schemas added - Frontend: Test button next to Save on both ntfy and RSS sections; result shown inline as a green/red pill; uses current form state for ntfy so the user can test before committing All future notification types should follow the same test-before-save pattern. Authored-By: Jack Levy
This commit is contained in:
@@ -28,6 +28,20 @@ class NotificationSettingsUpdate(BaseModel):
|
||||
ntfy_enabled: Optional[bool] = None
|
||||
rss_enabled: Optional[bool] = None
|
||||
|
||||
|
||||
class NtfyTestRequest(BaseModel):
|
||||
ntfy_topic_url: str
|
||||
ntfy_auth_method: str = "none"
|
||||
ntfy_token: str = ""
|
||||
ntfy_username: str = ""
|
||||
ntfy_password: str = ""
|
||||
|
||||
|
||||
class NotificationTestResult(BaseModel):
|
||||
status: str # "ok" | "error"
|
||||
detail: str
|
||||
event_count: Optional[int] = None # RSS only
|
||||
|
||||
T = TypeVar("T")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user