2021-03-08 18:12:59 +05:30
|
|
|
import axios from 'axios';
|
2021-04-29 21:17:54 +05:30
|
|
|
import { getJwt } from '~/jira_connect/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
|
|
|
},
|
|
|
|
});
|
|
|
|
};
|