Skip to content
Snippets Groups Projects
Commit 37cf9a36 authored by Gilgard's avatar Gilgard
Browse files

lint

parent 859ba61a
No related branches found
No related tags found
1 merge request!102Fix my communities
Pipeline #180617 passed
...@@ -2,9 +2,7 @@ ...@@ -2,9 +2,7 @@
<div <div
class="md:ring-1 ring-gray-300 rounded-xl overflow-hidden mx-auto mb-auto max-w-md w-full p-4" class="md:ring-1 ring-gray-300 rounded-xl overflow-hidden mx-auto mb-auto max-w-md w-full p-4"
> >
<h3 <h3 class="text-xl font-medium text-center text-primary-light mt-4 mb-8">
class="text-xl font-medium text-center text-primary-light mt-4 mb-8"
>
Glemt passordet ditt? Glemt passordet ditt?
</h3> </h3>
......
...@@ -3,9 +3,7 @@ ...@@ -3,9 +3,7 @@
class="md:ring-1 ring-gray-300 rounded-xl overflow-hidden mx-auto mb-auto max-w-md w-full p-4" class="md:ring-1 ring-gray-300 rounded-xl overflow-hidden mx-auto mb-auto max-w-md w-full p-4"
> >
<!-- Component heading --> <!-- Component heading -->
<h3 <h3 class="text-xl font-medium text-center text-primary-light mt-4 mb-8">
class="text-xl font-medium text-center text-primary-light mt-4 mb-8"
>
Opprett ny utleie Opprett ny utleie
</h3> </h3>
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
</div> </div>
</div> </div>
<colored-button <colored-button
v-if="!isRated" v-if="!isRated"
:text="'Vurder'" :text="'Vurder'"
class="px-4 flex-1" class="px-4 flex-1"
@click=" @click="
...@@ -97,7 +97,7 @@ export default { ...@@ -97,7 +97,7 @@ export default {
getDateString(milliseconds) { getDateString(milliseconds) {
let today = new Date(); let today = new Date();
let date = new Date(milliseconds); let date = new Date(milliseconds);
let dateString = date.getDate() + "." + (date.getMonth()+1); let dateString = date.getDate() + "." + (date.getMonth() + 1);
if (date.getFullYear() != today.getFullYear()) { if (date.getFullYear() != today.getFullYear()) {
dateString += "." + date.getFullYear(); dateString += "." + date.getFullYear();
...@@ -117,7 +117,6 @@ export default { ...@@ -117,7 +117,6 @@ export default {
this.user = await userService.getUserFromId(this.historyItem.renterId); this.user = await userService.getUserFromId(this.historyItem.renterId);
} }
this.isRated = await userService.isRated(this.historyItem.rentId); this.isRated = await userService.isRated(this.historyItem.rentId);
}, },
}; };
</script> </script>
<template> <template>
<div <div id="headline" class="text-xl md:text-2xl text-primary-light font-medium">
id="headline"
class="text-xl md:text-2xl text-primary-light font-medium"
>
Dine gjenstander Dine gjenstander
</div> </div>
<!-- Search field --> <!-- Search field -->
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
</li> </li>
<li> <li>
<router-link <router-link
:to="'/user/' + id + '/communites'" :to="'/profile/communities'"
class="block py-2 px-4 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white" class="block py-2 px-4 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white"
>Mine grupper >Mine grupper
</router-link> </router-link>
...@@ -88,7 +88,7 @@ ...@@ -88,7 +88,7 @@
{{ user.firstName }} {{ user.lastName }} {{ user.firstName }} {{ user.lastName }}
</h5> </h5>
<div> <div>
<rating-component :rating="renterRating" :ratingType="'Leietaker'"/> <rating-component :rating="renterRating" :ratingType="'Leietaker'" />
<rating-component :rating="ownerRating" :ratingType="'Utleier'" /> <rating-component :rating="ownerRating" :ratingType="'Utleier'" />
</div> </div>
...@@ -106,8 +106,8 @@ ...@@ -106,8 +106,8 @@
<script> <script>
import RatingComponent from "@/components/UserProfileComponents/RatingComponents/Rating.vue"; import RatingComponent from "@/components/UserProfileComponents/RatingComponents/Rating.vue";
import { parseCurrentUser } from "@/utils/token-utils"; import { parseCurrentUser } from "@/utils/token-utils";
import { getUser} from "@/utils/apiutil"; import { getUser } from "@/utils/apiutil";
import UserService from "@/services/user.service" import UserService from "@/services/user.service";
export default { export default {
name: "LargeProfileCard", name: "LargeProfileCard",
...@@ -137,12 +137,12 @@ export default { ...@@ -137,12 +137,12 @@ export default {
} }
this.user = await getUser(this.id); this.user = await getUser(this.id);
let ratingAsOwner = await UserService.getUserRatingAsOwner(this.id); let ratingAsOwner = await UserService.getUserRatingAsOwner(this.id);
let ratingAsRenter = await UserService.getUserRatingAsRenter(this.id) let ratingAsRenter = await UserService.getUserRatingAsRenter(this.id);
if (ratingAsOwner >= 0 && ratingAsOwner <= 5) { if (ratingAsOwner >= 0 && ratingAsOwner <= 5) {
this.ownerRating = ratingAsOwner; this.ownerRating = ratingAsOwner;
} }
if (ratingAsRenter >= 0 && ratingAsRenter <= 5){ if (ratingAsRenter >= 0 && ratingAsRenter <= 5) {
this.renterRating = ratingAsRenter; this.renterRating = ratingAsRenter;
} }
}, },
......
...@@ -5,27 +5,27 @@ import axios from "axios"; ...@@ -5,27 +5,27 @@ import axios from "axios";
const API_URL = process.env.VUE_APP_BASEURL; const API_URL = process.env.VUE_APP_BASEURL;
class UserService { class UserService {
async getUserFromId(userId) { async getUserFromId(userId) {
return await axios return await axios
.get(API_URL + "users/" + userId + "/profile", { .get(API_URL + "users/" + userId + "/profile", {
headers: tokenHeader(), headers: tokenHeader(),
}) })
.then((res) => { .then((res) => {
return res.data; return res.data;
}) })
.catch((err) => console.error(err)); .catch((err) => console.error(err));
} }
async getUserRatingAverage(userId) { async getUserRatingAverage(userId) {
return await axios return await axios
.get(API_URL + "rating/" + userId + "/average", { .get(API_URL + "rating/" + userId + "/average", {
headers: tokenHeader(), headers: tokenHeader(),
}) })
.then((res) => { .then((res) => {
return res.data; return res.data;
}) })
.catch((err) => console.error(err)); .catch((err) => console.error(err));
} }
async getRenterHistory() { async getRenterHistory() {
return await axios return await axios
...@@ -67,29 +67,26 @@ class UserService { ...@@ -67,29 +67,26 @@ class UserService {
}); });
} }
async getUserRatingAsRenter(userId) { async getUserRatingAsRenter(userId) {
return await axios return await axios
.get(API_URL + "rating/" + userId + "/average/renter", { .get(API_URL + "rating/" + userId + "/average/renter", {
headers: tokenHeader(), headers: tokenHeader(),
}) })
.then((res) => { .then((res) => {
return res.data; return res.data;
}) })
.catch((err) => console.error(err)) .catch((err) => console.error(err));
} }
async getUserRatingAsOwner(userId) { async getUserRatingAsOwner(userId) {
return await axios return await axios
.get(API_URL + "rating/" + userId + "/average/owner", { .get(API_URL + "rating/" + userId + "/average/owner", {
headers: tokenHeader(), headers: tokenHeader(),
}) })
.then((res) => { .then((res) => {
return res.data; return res.data;
}) })
.catch((err) => console.error(err)) .catch((err) => console.error(err));
} }
} }
export export default new UserService();
default
new
UserService();
\ No newline at end of file
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