diff --git a/src/components/FormComponents/ResetPasswordForm.vue b/src/components/FormComponents/ResetPasswordForm.vue index 6f95c5210690720b88148f5babcc73702e54ce6c..b075e1a983cd3e6734a57fc1fb4ab07cea02d2b3 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 b92f23e2e83e052bad971f79f699ac35cba373dc..67f8f3032c3dacdbfc19f2fc29652be86d3c1db5 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 33835dd8495e0e401982b33da58b1cf95c8ff229..675524104ec1ebe1b74410ae9114131c666f4023 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 02179d6620d3e0bf8e426ad24385c236b6f7f9d9..29deba9c6990b348a41796de1ba1f3d1d46d6a6e 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 3306a345483e2ea26c94444928c752065e65b239..7cca50f032d026465056b798792c8315706ecaa3 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 5c6ebb84dd73c423d690adda4a336089bd81cd55..b8f10603ecbd21ebfe0eec3b7e7d2227b025ffad 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();