Skip to content
Snippets Groups Projects
Commit 040eafe6 authored by henrikburmann's avatar henrikburmann
Browse files

Now actually sends time to DB

parent 0088709b
No related branches found
No related tags found
1 merge request!81Renting
......@@ -44,7 +44,10 @@
<div class="mt-6">
<!-- Add in method for displaying user card. Use item.userID on the method -->
(Placeholder) Add usercard here
<UserListItemCard :admin="false" :user="this.item.userID"></UserListItemCard>
<UserListItemCard
:admin="false"
:user="this.item.userID"
></UserListItemCard>
</div>
<div>
<div class="mt-4 space-y-6">
......@@ -112,21 +115,21 @@ export default {
async getItemPictures() {
let id = this.$router.currentRoute.value.params.id;
this.images = await getItemPictures(id);
if(this.images.length < 1) {
let noImage = {
src: require('@/assets/default-product.png'),
alt: "No image found",
};
this.pictures.push(noImage);
if (this.images.length < 1) {
let noImage = {
src: require("@/assets/default-product.png"),
alt: "No image found",
};
this.pictures.push(noImage);
} else {
for (let i = 0; i < this.images.length; i++) {
let oneImage = {
src: this.images[i].picture,
//How do i make this accurate to the image?
alt: "An image",
};
this.pictures.push(oneImage);
let oneImage = {
src: this.images[i].picture,
//How do i make this accurate to the image?
alt: "An image",
};
this.pictures.push(oneImage);
}
}
//TODO fixs so each image get a correct alt text.
......
......@@ -46,11 +46,10 @@ export default {
title: this.newRentBox.title,
fromTime: this.newRentBox.fromTime,
toTime: this.newRentBox.toTime,
fromTimeMilliseconds: new Date(this.newRentBox.fromTime).getMilliseconds,
toTimeMilliseconds: new Date(this.newRentBox.toTime).getMilliseconds,
fromTimeMilliseconds: new Date(this.newRentBox.fromTime).valueOf(),
toTimeMilliseconds: new Date(this.newRentBox.toTime).valueOf(),
message: "",
price: this.newRentBox.price_per_day,
};
},
props: {
......@@ -71,13 +70,14 @@ export default {
},
sendRent: async function () {
const rent = {
// message: this.message,
message: this.message,
listingId: this.newRentBox.listingId,
renterId: this.newRentBox.renterId,
isAccepted: false,
toTime: this.toTimeMilliseconds,
fromTime: this.fromTimeMilliseconds,
fromTime: this.fromTimeMilliseconds,
};
await postNewRent(rent);
console.log(rent);
},
......
......@@ -103,7 +103,7 @@ const routes = [
name: "newRent",
component: () => import("../views/RentingViews/NewRentView.vue"),
},
{
{
beforeEnter: guardRoute,
path: "/test",
name: "test",
......
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