From 37cf9a365771fd312aad79b5839fa83949faf616 Mon Sep 17 00:00:00 2001 From: Gilgard <Hjelljord.alida@gmail.com> Date: Wed, 4 May 2022 12:54:00 +0200 Subject: [PATCH] lint --- .../FormComponents/ResetPasswordForm.vue | 4 +- src/components/ItemComponents/NewItemForm.vue | 4 +- .../RentHistoryComponents/RentHistoryItem.vue | 5 +- .../UserProfileComponents/UserItems.vue | 5 +- .../UserProfileComponents/UserProfile.vue | 12 +-- src/services/user.service.js | 79 +++++++++---------- 6 files changed, 49 insertions(+), 60 deletions(-) diff --git a/src/components/FormComponents/ResetPasswordForm.vue b/src/components/FormComponents/ResetPasswordForm.vue index 6f95c52..b075e1a 100644 --- a/src/components/FormComponents/ResetPasswordForm.vue +++ b/src/components/FormComponents/ResetPasswordForm.vue @@ -2,9 +2,7 @@ <div class="md:ring-1 ring-gray-300 rounded-xl overflow-hidden mx-auto mb-auto max-w-md w-full p-4" > - <h3 - class="text-xl font-medium text-center text-primary-light mt-4 mb-8" - > + <h3 class="text-xl font-medium text-center text-primary-light mt-4 mb-8"> Glemt passordet ditt? </h3> diff --git a/src/components/ItemComponents/NewItemForm.vue b/src/components/ItemComponents/NewItemForm.vue index b92f23e..67f8f30 100644 --- a/src/components/ItemComponents/NewItemForm.vue +++ b/src/components/ItemComponents/NewItemForm.vue @@ -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" > <!-- Component heading --> - <h3 - class="text-xl font-medium text-center text-primary-light mt-4 mb-8" - > + <h3 class="text-xl font-medium text-center text-primary-light mt-4 mb-8"> Opprett ny utleie </h3> diff --git a/src/components/UserProfileComponents/RentHistoryComponents/RentHistoryItem.vue b/src/components/UserProfileComponents/RentHistoryComponents/RentHistoryItem.vue index 33835dd..6755241 100644 --- a/src/components/UserProfileComponents/RentHistoryComponents/RentHistoryItem.vue +++ b/src/components/UserProfileComponents/RentHistoryComponents/RentHistoryItem.vue @@ -21,7 +21,7 @@ </div> </div> <colored-button - v-if="!isRated" + v-if="!isRated" :text="'Vurder'" class="px-4 flex-1" @click=" @@ -97,7 +97,7 @@ export default { getDateString(milliseconds) { let today = new Date(); let date = new Date(milliseconds); - let dateString = date.getDate() + "." + (date.getMonth()+1); + let dateString = date.getDate() + "." + (date.getMonth() + 1); if (date.getFullYear() != today.getFullYear()) { dateString += "." + date.getFullYear(); @@ -117,7 +117,6 @@ export default { this.user = await userService.getUserFromId(this.historyItem.renterId); } this.isRated = await userService.isRated(this.historyItem.rentId); - }, }; </script> diff --git a/src/components/UserProfileComponents/UserItems.vue b/src/components/UserProfileComponents/UserItems.vue index 02179d6..29deba9 100644 --- a/src/components/UserProfileComponents/UserItems.vue +++ b/src/components/UserProfileComponents/UserItems.vue @@ -1,8 +1,5 @@ <template> - <div - id="headline" - class="text-xl md:text-2xl text-primary-light font-medium" - > + <div id="headline" class="text-xl md:text-2xl text-primary-light font-medium"> Dine gjenstander </div> <!-- Search field --> diff --git a/src/components/UserProfileComponents/UserProfile.vue b/src/components/UserProfileComponents/UserProfile.vue index 3306a34..7cca50f 100644 --- a/src/components/UserProfileComponents/UserProfile.vue +++ b/src/components/UserProfileComponents/UserProfile.vue @@ -40,7 +40,7 @@ </li> <li> <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" >Mine grupper </router-link> @@ -88,7 +88,7 @@ {{ user.firstName }} {{ user.lastName }} </h5> <div> - <rating-component :rating="renterRating" :ratingType="'Leietaker'"/> + <rating-component :rating="renterRating" :ratingType="'Leietaker'" /> <rating-component :rating="ownerRating" :ratingType="'Utleier'" /> </div> @@ -106,8 +106,8 @@ <script> import RatingComponent from "@/components/UserProfileComponents/RatingComponents/Rating.vue"; import { parseCurrentUser } from "@/utils/token-utils"; -import { getUser} from "@/utils/apiutil"; -import UserService from "@/services/user.service" +import { getUser } from "@/utils/apiutil"; +import UserService from "@/services/user.service"; export default { name: "LargeProfileCard", @@ -137,12 +137,12 @@ export default { } this.user = await getUser(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) { this.ownerRating = ratingAsOwner; } - if (ratingAsRenter >= 0 && ratingAsRenter <= 5){ + if (ratingAsRenter >= 0 && ratingAsRenter <= 5) { this.renterRating = ratingAsRenter; } }, diff --git a/src/services/user.service.js b/src/services/user.service.js index 5c6ebb8..b8f1060 100644 --- a/src/services/user.service.js +++ b/src/services/user.service.js @@ -5,27 +5,27 @@ import axios from "axios"; const API_URL = process.env.VUE_APP_BASEURL; class UserService { - async getUserFromId(userId) { - return await axios - .get(API_URL + "users/" + userId + "/profile", { - headers: tokenHeader(), - }) - .then((res) => { - return res.data; - }) - .catch((err) => console.error(err)); - } + async getUserFromId(userId) { + return await axios + .get(API_URL + "users/" + userId + "/profile", { + headers: tokenHeader(), + }) + .then((res) => { + return res.data; + }) + .catch((err) => console.error(err)); + } - async getUserRatingAverage(userId) { - return await axios - .get(API_URL + "rating/" + userId + "/average", { - headers: tokenHeader(), - }) - .then((res) => { - return res.data; - }) - .catch((err) => console.error(err)); - } + async getUserRatingAverage(userId) { + return await axios + .get(API_URL + "rating/" + userId + "/average", { + headers: tokenHeader(), + }) + .then((res) => { + return res.data; + }) + .catch((err) => console.error(err)); + } async getRenterHistory() { return await axios @@ -67,29 +67,26 @@ class UserService { }); } - async getUserRatingAsRenter(userId) { - return await axios - .get(API_URL + "rating/" + userId + "/average/renter", { - headers: tokenHeader(), - }) - .then((res) => { - return res.data; - }) - .catch((err) => console.error(err)) - } + async getUserRatingAsRenter(userId) { + return await axios + .get(API_URL + "rating/" + userId + "/average/renter", { + headers: tokenHeader(), + }) + .then((res) => { + return res.data; + }) + .catch((err) => console.error(err)); + } async getUserRatingAsOwner(userId) { return await axios - .get(API_URL + "rating/" + userId + "/average/owner", { - headers: tokenHeader(), - }) - .then((res) => { - return res.data; - }) - .catch((err) => console.error(err)) + .get(API_URL + "rating/" + userId + "/average/owner", { + headers: tokenHeader(), + }) + .then((res) => { + return res.data; + }) + .catch((err) => console.error(err)); } } - export - default - new - UserService(); \ No newline at end of file +export default new UserService(); -- GitLab