summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/jira_connect/api.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/jira_connect/api.js')
-rw-r--r--app/assets/javascripts/jira_connect/api.js24
1 files changed, 3 insertions, 21 deletions
diff --git a/app/assets/javascripts/jira_connect/api.js b/app/assets/javascripts/jira_connect/api.js
index d78aba0a3f7..abf2c070e68 100644
--- a/app/assets/javascripts/jira_connect/api.js
+++ b/app/assets/javascripts/jira_connect/api.js
@@ -1,24 +1,5 @@
import axios from 'axios';
-
-export const getJwt = () => {
- return new Promise((resolve) => {
- AP.context.getToken((token) => {
- resolve(token);
- });
- });
-};
-
-export const getLocation = () => {
- return new Promise((resolve) => {
- if (typeof AP.getLocation !== 'function') {
- resolve();
- }
-
- AP.getLocation((location) => {
- resolve(location);
- });
- });
-};
+import { getJwt } from '~/jira_connect/utils';
export const addSubscription = async (addPath, namespace) => {
const jwt = await getJwt();
@@ -39,11 +20,12 @@ export const removeSubscription = async (removePath) => {
});
};
-export const fetchGroups = async (groupsPath, { page, perPage }) => {
+export const fetchGroups = async (groupsPath, { page, perPage, search }) => {
return axios.get(groupsPath, {
params: {
page,
per_page: perPage,
+ search,
},
});
};