mirror of
https://github.com/binwiederhier/ntfy.git
synced 2025-06-17 18:13:21 +02:00
Split out AccountApi
This commit is contained in:
parent
d4c7ad4beb
commit
276301dc87
11 changed files with 251 additions and 222 deletions
web/src/components
|
@ -8,7 +8,8 @@ import connectionManager from "../app/ConnectionManager";
|
|||
import poller from "../app/Poller";
|
||||
import pruner from "../app/Pruner";
|
||||
import session from "../app/Session";
|
||||
import api, {UnauthorizedError} from "../app/Api";
|
||||
import {UnauthorizedError} from "../app/AccountApi";
|
||||
import accountApi from "../app/AccountApi";
|
||||
|
||||
/**
|
||||
* Wire connectionManager and subscriptionManager so that subscriptions are updated when the connection
|
||||
|
@ -65,7 +66,7 @@ export const useAutoSubscribe = (subscriptions, selected) => {
|
|||
const subscription = await subscriptionManager.add(baseUrl, params.topic);
|
||||
if (session.exists()) {
|
||||
try {
|
||||
const remoteSubscription = await api.addAccountSubscription(config.baseUrl, session.token(), {
|
||||
const remoteSubscription = await accountApi.addSubscription({
|
||||
base_url: baseUrl,
|
||||
topic: params.topic
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue