Skip to content

Commit

Permalink
refactor #14: Remove token code from userApi
Browse files Browse the repository at this point in the history
  • Loading branch information
Boosmith committed Sep 2, 2019
1 parent 8deb193 commit f523e7f
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/api/userApi.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
import { handleResponse, handleError } from "./apiUtils";
const baseUrl = process.env.REACT_APP_API_URL + "/api/users/";

const bearerHeaders = {
headers: { Authorization: "Bearer " + getToken() }
};

export function getUsers() {
return fetch(baseUrl, bearerHeaders)
return fetch(baseUrl)
.then(handleResponse)
.catch(handleError);
}
Expand All @@ -32,7 +28,3 @@ export function deleteUser(userId) {
.then(handleResponse)
.catch(handleError);
}

function getToken() {
return localStorage.getItem("trelloid_token");
}

0 comments on commit f523e7f

Please sign in to comment.