From 94b1d070a67ccbdcf35d30edf4e33cb70119d19e Mon Sep 17 00:00:00 2001 From: Gilgard <Hjelljord.alida@gmail.com> Date: Wed, 27 Apr 2022 10:00:51 +0200 Subject: [PATCH] updated rating to average --- src/utils/apiutil.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/utils/apiutil.js b/src/utils/apiutil.js index 94dee18..d3156fe 100644 --- a/src/utils/apiutil.js +++ b/src/utils/apiutil.js @@ -71,3 +71,16 @@ export function getOwnerRating(userid) { console.error(error); }); } + +export function getAverageRating(userid) { + return axios + .get(API_URL + "rating/" + userid + "/average", { + headers: tokenHeader(), + }) + .then((response) => { + return response.data; + }) + .catch((error) => { + console.error(error); + }); +} -- GitLab