Image?
This commit is contained in:
@@ -22,15 +22,15 @@ router.route("/log/wines").post(async (req, res) => {
|
|||||||
res.send(false);
|
res.send(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
console.log(req.body);
|
|
||||||
const wines = req.body;
|
const wines = req.body;
|
||||||
console.log(wines);
|
|
||||||
for (let i = 0; i < wines.length; i++) {
|
for (let i = 0; i < wines.length; i++) {
|
||||||
let wine = wines[i];
|
let wine = wines[i];
|
||||||
let newWonWine = new PreLotteryWine({
|
let newWonWine = new PreLotteryWine({
|
||||||
name: wine.name,
|
name: wine.name,
|
||||||
vivinoLink: wine.vivinoLink,
|
vivinoLink: wine.vivinoLink,
|
||||||
rating: wine.rating
|
rating: wine.rating,
|
||||||
|
image: wine.image,
|
||||||
|
id: wine.id
|
||||||
});
|
});
|
||||||
await newWonWine.save();
|
await newWonWine.save();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,9 @@ const Schema = mongoose.Schema;
|
|||||||
const PreLotteryWine = new Schema({
|
const PreLotteryWine = new Schema({
|
||||||
name: String,
|
name: String,
|
||||||
vivinoLink: String,
|
vivinoLink: String,
|
||||||
rating: Number
|
rating: Number,
|
||||||
|
id: String,
|
||||||
|
image: String
|
||||||
});
|
});
|
||||||
|
|
||||||
module.exports = mongoose.model("PreLotteryWine", PreLotteryWine);
|
module.exports = mongoose.model("PreLotteryWine", PreLotteryWine);
|
||||||
|
|||||||
@@ -5,7 +5,9 @@ const Wine = new Schema({
|
|||||||
name: String,
|
name: String,
|
||||||
vivinoLink: String,
|
vivinoLink: String,
|
||||||
rating: Number,
|
rating: Number,
|
||||||
occurences: Number
|
occurences: Number,
|
||||||
|
id: String,
|
||||||
|
image: String
|
||||||
});
|
});
|
||||||
|
|
||||||
module.exports = mongoose.model("Wine", Wine);
|
module.exports = mongoose.model("Wine", Wine);
|
||||||
|
|||||||
@@ -27,6 +27,8 @@
|
|||||||
Vinnere
|
Vinnere
|
||||||
<div v-for="winner in winners" class="winner-element">
|
<div v-for="winner in winners" class="winner-element">
|
||||||
<hr />
|
<hr />
|
||||||
|
<div class="winnner-container-inner">
|
||||||
|
<div class="input-container">
|
||||||
<div class="label-div">
|
<div class="label-div">
|
||||||
<input type="text" v-model="winner.name" placeholder="Navn" />
|
<input type="text" v-model="winner.name" placeholder="Navn" />
|
||||||
</div>
|
</div>
|
||||||
@@ -59,6 +61,11 @@
|
|||||||
placeholder="Rating"
|
placeholder="Rating"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="wine-image">
|
||||||
|
<img :src="winner.wine.image" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<hr />
|
<hr />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -80,6 +87,12 @@
|
|||||||
placeholder="Vivino-link"
|
placeholder="Vivino-link"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="label-div">
|
||||||
|
<input type="text" v-model="wine.id" placeholder="Id" />
|
||||||
|
</div>
|
||||||
|
<div class="label-div">
|
||||||
|
<input type="text" v-model="wine.image" placeholder="Bilde" />
|
||||||
|
</div>
|
||||||
<div class="label-div">
|
<div class="label-div">
|
||||||
<input type="text" v-model="wine.rating" placeholder="Rating" />
|
<input type="text" v-model="wine.rating" placeholder="Rating" />
|
||||||
</div>
|
</div>
|
||||||
@@ -112,7 +125,9 @@ export default {
|
|||||||
wine: {
|
wine: {
|
||||||
name: wine.name,
|
name: wine.name,
|
||||||
vivinoLink: wine.vivinoLink,
|
vivinoLink: wine.vivinoLink,
|
||||||
rating: wine.rating
|
rating: wine.rating,
|
||||||
|
image: wine.image,
|
||||||
|
id: wine.id
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -122,7 +137,9 @@ export default {
|
|||||||
this.wines.push({
|
this.wines.push({
|
||||||
name: "",
|
name: "",
|
||||||
vivinoLink: "",
|
vivinoLink: "",
|
||||||
rating: ""
|
rating: "",
|
||||||
|
id: "",
|
||||||
|
image: ""
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
sendWines: async function() {
|
sendWines: async function() {
|
||||||
@@ -235,8 +252,6 @@ input {
|
|||||||
font-size: 1.5rem;
|
font-size: 1.5rem;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
.label-div {
|
|
||||||
}
|
|
||||||
hr {
|
hr {
|
||||||
width: 50vw;
|
width: 50vw;
|
||||||
}
|
}
|
||||||
@@ -297,6 +312,24 @@ hr {
|
|||||||
font-size: 1.22rem;
|
font-size: 1.22rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.input-container {
|
||||||
|
& .label-div {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.winnner-container-inner {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wine-image {
|
||||||
|
padding-left: 30px;
|
||||||
|
|
||||||
|
& img {
|
||||||
|
height: 400px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
input,
|
input,
|
||||||
button {
|
button {
|
||||||
font-size: 1.5rem;
|
font-size: 1.5rem;
|
||||||
|
|||||||
Reference in New Issue
Block a user