some cleanup and css fix for mobile
This commit is contained in:
@@ -22,7 +22,6 @@ router.route("/request").get(async (req, res) => {
|
|||||||
|
|
||||||
router.route("/request").post(async (req, res) => {
|
router.route("/request").post(async (req, res) => {
|
||||||
const {wine} = req.body
|
const {wine} = req.body
|
||||||
console.log(wine)
|
|
||||||
|
|
||||||
let thisWineIsLOKO = await Wine.findOne({id: wine.id})
|
let thisWineIsLOKO = await Wine.findOne({id: wine.id})
|
||||||
|
|
||||||
@@ -37,12 +36,10 @@ router.route("/request").post(async (req, res) => {
|
|||||||
});
|
});
|
||||||
await thisWineIsLOKO.save()
|
await thisWineIsLOKO.save()
|
||||||
}
|
}
|
||||||
console.log(thisWineIsLOKO)
|
|
||||||
|
|
||||||
let requestedWine = await RequestedWine.findOne({ "wineId": wine.id})
|
let requestedWine = await RequestedWine.findOne({ "wineId": wine.id})
|
||||||
|
|
||||||
if(requestedWine == undefined){
|
if(requestedWine == undefined){
|
||||||
// console.log(localWine)
|
|
||||||
requestedWine = new RequestedWine({
|
requestedWine = new RequestedWine({
|
||||||
count: 1,
|
count: 1,
|
||||||
wineId: wine.id,
|
wineId: wine.id,
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ const convertToOurWineObject = wine => {
|
|||||||
|
|
||||||
router.route("/wineinfo/search").get(async (req, res) => {
|
router.route("/wineinfo/search").get(async (req, res) => {
|
||||||
const {query} = req.query
|
const {query} = req.query
|
||||||
let url = new URL(`https://apis.vinmonopolet.no/products/v0/details-normal?productShortNameContains=test&maxResults=5`)
|
let url = new URL(`https://apis.vinmonopolet.no/products/v0/details-normal?productShortNameContains=test&maxResults=15`)
|
||||||
url.searchParams.set('productShortNameContains', query)
|
url.searchParams.set('productShortNameContains', query)
|
||||||
|
|
||||||
const vinmonopoletResponse = await fetch(url, {
|
const vinmonopoletResponse = await fetch(url, {
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
<section class="buttons">
|
<section class="buttons">
|
||||||
<button class="vin-button" @click="request(wine)">Send inn denne som ønske</button>
|
<button class="vin-button" @click="request(wine)">Foreslå denne</button>
|
||||||
<a
|
<a
|
||||||
v-if="wine.vivinoLink"
|
v-if="wine.vivinoLink"
|
||||||
:href="wine.vivinoLink"
|
:href="wine.vivinoLink"
|
||||||
@@ -78,7 +78,6 @@ export default {
|
|||||||
|
|
||||||
fetch("http://localhost:30030/api/request", options)
|
fetch("http://localhost:30030/api/request", options)
|
||||||
.then(res => res.json())
|
.then(res => res.json())
|
||||||
.then(console.log)
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -155,6 +154,25 @@ input[type="text"] {
|
|||||||
width: 40%;
|
width: 40%;
|
||||||
margin-right: 1rem;
|
margin-right: 1rem;
|
||||||
}
|
}
|
||||||
|
@include mobile {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
.wine-image {
|
||||||
|
height: 100px;
|
||||||
|
width: 50px;
|
||||||
|
align-self: center;
|
||||||
|
}
|
||||||
|
.buttons{
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-self: center;
|
||||||
|
margin: 1em;
|
||||||
|
.wine-link{
|
||||||
|
margin-top: 1em;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user