gitlab-org--gitlab-foss/app/assets/javascripts/environments/vue_resource_interceptor.js.es6
Filipa Lacerda b210cbca6c Fix eslint errors
Fix rubocop error
2016-11-16 11:58:25 +00:00

12 lines
348 B
JavaScript

/* global Vue */
Vue.http.interceptors.push((request, next) => {
Vue.activeResources = Vue.activeResources ? Vue.activeResources + 1 : 1;
next((response) => {
if (typeof response.data === 'string') {
response.data = JSON.parse(response.data); // eslint-disable-line
}
Vue.activeResources--; // eslint-disable-line
});
});