UNCLASSIFIED

Commit 69bde358 authored by Graham Smith's avatar Graham Smith
Browse files

fix mock user role

parent ac1a3d0d
...@@ -9,11 +9,19 @@ const getUserApi = async () => { ...@@ -9,11 +9,19 @@ const getUserApi = async () => {
// TODO: remove this temp code once the API includes role data // TODO: remove this temp code once the API includes role data
const user = response.data; const user = response.data;
user.auth = { const existingUserJson = localStorage.getItem("user");
role: "user" if (existingUserJson) {
}; const existingUser = JSON.parse(existingUserJson);
user.auth = existingUser.auth;
}
if (!user.auth) {
user.auth = {
role: "user"
};
}
console.log("user:", user); localStorage.setItem("user", JSON.stringify(user));
// end temp code
return user; return user;
}; };
......
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