diff options
author | LASER-Yi <[email protected]> | 2021-04-16 00:46:19 +0800 |
---|---|---|
committer | LASER-Yi <[email protected]> | 2021-04-16 00:46:19 +0800 |
commit | 385cc214b348815105bc654df3fc710b25a3e620 (patch) | |
tree | eb61827aae8172687b333241c172219189005468 | |
parent | 56958488b6f90c04d35fb80872dfb88ae62e9e91 (diff) | |
download | bazarr-385cc214b348815105bc654df3fc710b25a3e620.tar.gz bazarr-385cc214b348815105bc654df3fc710b25a3e620.zip |
Fix issues when testing notifications
-rw-r--r-- | bazarr/api.py | 5 | ||||
-rw-r--r-- | frontend/src/Settings/Notifications/components.tsx | 2 | ||||
-rw-r--r-- | frontend/src/apis/system.ts | 4 |
3 files changed, 5 insertions, 6 deletions
diff --git a/bazarr/api.py b/bazarr/api.py index 0fb02d8af..8e7957064 100644 --- a/bazarr/api.py +++ b/bazarr/api.py @@ -377,14 +377,13 @@ class LanguagesProfiles(Resource): class Notifications(Resource): @authenticate def patch(self): - protocol = request.form.get("protocol") - path = request.form.get("path") + url = request.form.get("url") asset = apprise.AppriseAsset(async_mode=False) apobj = apprise.Apprise(asset=asset) - apobj.add(f"{protocol}://{path}") + apobj.add(url) apobj.notify( title='Bazarr test notification', diff --git a/frontend/src/Settings/Notifications/components.tsx b/frontend/src/Settings/Notifications/components.tsx index c924f4a8d..587ffdb24 100644 --- a/frontend/src/Settings/Notifications/components.tsx +++ b/frontend/src/Settings/Notifications/components.tsx @@ -84,7 +84,7 @@ const NotificationModal: FunctionComponent<ModalProps & BaseModalProps> = ({ variant="outline-secondary" promise={() => { if (current && current.url) { - return SystemApi.testNotification(current.name, current.url); + return SystemApi.testNotification(current.url); } else { return null; } diff --git a/frontend/src/apis/system.ts b/frontend/src/apis/system.ts index 3dac5d126..bc0bb181c 100644 --- a/frontend/src/apis/system.ts +++ b/frontend/src/apis/system.ts @@ -137,9 +137,9 @@ class SystemApi extends BaseApi { }); } - async testNotification(protocol: string, path: string) { + async testNotification(url: string) { return new Promise<void>((resolve, reject) => { - this.patch<void>("/notifications", { protocol, path }) + this.patch<void>("/notifications", { url }) .then(() => resolve()) .catch(reject); }); |