2021-03-08 18:12:59 +05:30
|
|
|
import axios from 'axios';
|
2021-10-27 15:23:28 +05:30
|
|
|
import { getJwt } from './utils';
|
2021-03-08 18:12:59 +05:30
|
|
|
|
|
|
|
export const addSubscription = async (addPath, namespace) => {
|
|
|
|
const jwt = await getJwt();
|
|
|
|
|
|
|
|
return axios.post(addPath, {
|
|
|
|
jwt,
|
|
|
|
namespace_path: namespace,
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
export const removeSubscription = async (removePath) => {
|
|
|
|
const jwt = await getJwt();
|
|
|
|
|
|
|
|
return axios.delete(removePath, {
|
|
|
|
params: {
|
|
|
|
jwt,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
2021-04-29 21:17:54 +05:30
|
|
|
export const fetchGroups = async (groupsPath, { page, perPage, search }) => {
|
2021-03-08 18:12:59 +05:30
|
|
|
return axios.get(groupsPath, {
|
|
|
|
params: {
|
|
|
|
page,
|
|
|
|
per_page: perPage,
|
2021-04-29 21:17:54 +05:30
|
|
|
search,
|
2021-03-08 18:12:59 +05:30
|
|
|
},
|
|
|
|
});
|
|
|
|
};
|
2022-07-16 23:28:13 +05:30
|
|
|
|
|
|
|
export const fetchSubscriptions = async (subscriptionsPath) => {
|
|
|
|
const jwt = await getJwt();
|
|
|
|
|
|
|
|
return axios.get(subscriptionsPath, {
|
|
|
|
params: {
|
|
|
|
jwt,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
};
|