BigW Consortium Gitlab

Commit 88fb39c2 by Phil Hughes

Uses shared vue resource interceptor

parent f9c58d93
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
const Vue = window.Vue = require('vue'); const Vue = window.Vue = require('vue');
window.Vue.use(require('vue-resource')); window.Vue.use(require('vue-resource'));
require('../../vue_shared/vue_resource_interceptor');
(() => { (() => {
window.gl = window.gl || {}; window.gl = window.gl || {};
...@@ -12,13 +13,6 @@ window.Vue.use(require('vue-resource')); ...@@ -12,13 +13,6 @@ window.Vue.use(require('vue-resource'));
constructor(root) { constructor(root) {
this.noteResource = Vue.resource(`${root}/notes{/noteId}/resolve`); this.noteResource = Vue.resource(`${root}/notes{/noteId}/resolve`);
this.discussionResource = Vue.resource(`${root}/merge_requests{/mergeRequestId}/discussions{/discussionId}/resolve`); this.discussionResource = Vue.resource(`${root}/merge_requests{/mergeRequestId}/discussions{/discussionId}/resolve`);
Vue.http.interceptors.push((request, next) => {
if ($.rails) {
request.headers['X-CSRF-Token'] = $.rails.csrfToken();
}
next();
});
} }
resolve(noteId) { resolve(noteId) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment