Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/jira_connect/api.js')
-rw-r--r--app/assets/javascripts/jira_connect/api.js20
1 files changed, 18 insertions, 2 deletions
diff --git a/app/assets/javascripts/jira_connect/api.js b/app/assets/javascripts/jira_connect/api.js
index d689a2d1962..d78aba0a3f7 100644
--- a/app/assets/javascripts/jira_connect/api.js
+++ b/app/assets/javascripts/jira_connect/api.js
@@ -1,7 +1,23 @@
import axios from 'axios';
-const getJwt = async () => {
- return AP.context.getToken();
+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);
+ });
+ });
};
export const addSubscription = async (addPath, namespace) => {