Skip to content
Snippets Groups Projects
Commit 79c6678d authored by Erik Borgeteien Hansen's avatar Erik Borgeteien Hansen
Browse files

add headers to user.service

parent 451b79d5
No related branches found
No related tags found
1 merge request!88Community admin
// import { tokenHeader } from "@/utils/token-utils";
import { tokenHeader } from "@/utils/token-utils";
import axios from "axios";
const API_URL = process.env.VUE_APP_BASEURL;
......@@ -6,7 +7,9 @@ const API_URL = process.env.VUE_APP_BASEURL;
class UserService {
async getUserFromId(userId) {
return await axios
.get(API_URL + "/users/" + userId + "/profile")
.get(API_URL + "/users/" + userId + "/profile", {
headers: tokenHeader(),
})
.then((res) => {
return res.data;
})
......@@ -15,7 +18,9 @@ class UserService {
async getUserRatingAverage(userId) {
return await axios
.get(API_URL + "rating/" + userId + "/average")
.get(API_URL + "rating/" + userId + "/average", {
headers: tokenHeader(),
})
.then((res) => {
return res.data;
})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment