debian-mirror-gitlab/app/assets/javascripts/jira_connect/subscriptions/api.js

32 lines
596 B
JavaScript
Raw Normal View History

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
},
});
};