From 2beb872de97bb966b3ddca5149122207ca460907 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Delattre?= Date: Fri, 2 Jun 2017 21:23:21 +0200 Subject: [PATCH] Lint request.js --- src/public/js/requests.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/public/js/requests.js b/src/public/js/requests.js index 424fbb4..f264068 100644 --- a/src/public/js/requests.js +++ b/src/public/js/requests.js @@ -1,12 +1,12 @@ -import axios from 'axios' +import axios from "axios" // This functions returns an axios instance, the token is added to the // configuration if found in the localStorage export function configureAxios(headers = {}) { // Get the token from the localStorate - const token = localStorage.getItem('token'); + const token = localStorage.getItem("token"); if (token) { - headers = { 'Authorization': `Bearer ${token}` }; + headers = { "Authorization": `Bearer ${token}` }; } return axios.create({ @@ -30,10 +30,10 @@ export function request(eventPrefix, promise, callbackEvents = null, mainPayload }) promise .then(response => { - if (response.data.status === 'error') + if (response.data.status === "error") { dispatch({ - type: 'ADD_ALERT_ERROR', + type: "ADD_ALERT_ERROR", payload: { message: response.data.message, main: mainPayload, @@ -58,11 +58,11 @@ export function request(eventPrefix, promise, callbackEvents = null, mainPayload // Unauthorized if (error.response && error.response.status == 401) { dispatch({ - type: 'USER_LOGOUT', + type: "USER_LOGOUT", }) } dispatch({ - type: 'ADD_ALERT_ERROR', + type: "ADD_ALERT_ERROR", payload: { message: error.response.data, main: mainPayload,