WIP Functionality to request wines for next lottery #24
@@ -48,7 +48,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { searchForWine } from "@/api";
|
||||
import { searchForWine, requestNewWine } from "@/api";
|
||||
import Wine from "@/ui/Wine";
|
||||
import Modal from "@/ui/Modal";
|
||||
|
||||
@@ -84,19 +84,7 @@ export default {
|
||||
}
|
||||
},
|
||||
request(wine){
|
||||
const options = {
|
||||
body: JSON.stringify({
|
||||
wine: wine
|
||||
}),
|
||||
headers: {
|
||||
'Accept': 'application/json',
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
method: "post"
|
||||
}
|
||||
|
||||
fetch("http://localhost:30030/api/request/new-wine", options)
|
||||
.then(res => res.json())
|
||||
requestNewWine(wine)
|
||||
.then(() => this.showModal = true)
|
||||
},
|
||||
emitFromModalButton(action){
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { deleteRequestedWine } from "@/api";
|
||||
|
Rename too Rename too `wineDeleted` and emit the wine element.
Vinnere ? Vinnere ?
fixed fixed
🤷♂️ fixed 🤷♂️ fixed
|
||||
import { deleteRequestedWine, requestNewWine } from "@/api";
|
||||
|
Rename too Rename too `wineDeleted` and emit the wine element.
Vinnere ? Vinnere ?
fixed fixed
🤷♂️ fixed 🤷♂️ fixed
|
||||
|
||||
export default {
|
||||
data(){
|
||||
@@ -46,18 +46,7 @@ export default {
|
||||
|
Rename too Rename too `wineDeleted` and emit the wine element.
Rename too Rename too `wineDeleted` and emit the wine element.
Vinnere ? Vinnere ?
Vinnere ? Vinnere ?
fixed fixed
fixed fixed
🤷♂️ fixed 🤷♂️ fixed
🤷♂️ fixed 🤷♂️ fixed
|
||||
request(wine){
|
||||
this.locallyRequested = true
|
||||
this.requestedElement.count = this.requestedElement.count +1
|
||||
const options = {
|
||||
|
Rename too Rename too `wineDeleted` and emit the wine element.
Vinnere ? Vinnere ?
fixed fixed
🤷♂️ fixed 🤷♂️ fixed
|
||||
body: JSON.stringify({
|
||||
|
Rename too Rename too `wineDeleted` and emit the wine element.
Vinnere ? Vinnere ?
fixed fixed
🤷♂️ fixed 🤷♂️ fixed
|
||||
wine: wine
|
||||
|
Rename too Rename too `wineDeleted` and emit the wine element.
Vinnere ? Vinnere ?
fixed fixed
🤷♂️ fixed 🤷♂️ fixed
|
||||
}),
|
||||
|
Rename too Rename too `wineDeleted` and emit the wine element.
Vinnere ? Vinnere ?
fixed fixed
🤷♂️ fixed 🤷♂️ fixed
|
||||
headers: {
|
||||
|
Rename too Rename too `wineDeleted` and emit the wine element.
Vinnere ? Vinnere ?
fixed fixed
🤷♂️ fixed 🤷♂️ fixed
|
||||
'Accept': 'application/json',
|
||||
|
Rename too Rename too `wineDeleted` and emit the wine element.
Vinnere ? Vinnere ?
fixed fixed
🤷♂️ fixed 🤷♂️ fixed
|
||||
'Content-Type': 'application/json'
|
||||
|
Rename too Rename too `wineDeleted` and emit the wine element.
Vinnere ? Vinnere ?
fixed fixed
🤷♂️ fixed 🤷♂️ fixed
|
||||
},
|
||||
|
Rename too Rename too `wineDeleted` and emit the wine element.
Vinnere ? Vinnere ?
fixed fixed
🤷♂️ fixed 🤷♂️ fixed
|
||||
method: "post"
|
||||
|
Rename too Rename too `wineDeleted` and emit the wine element.
Vinnere ? Vinnere ?
fixed fixed
🤷♂️ fixed 🤷♂️ fixed
|
||||
}
|
||||
|
Rename too Rename too `wineDeleted` and emit the wine element.
Vinnere ? Vinnere ?
fixed fixed
🤷♂️ fixed 🤷♂️ fixed
|
||||
fetch("http://localhost:30030/api/request/new-wine", options)
|
||||
|
Rename too Rename too `wineDeleted` and emit the wine element.
Vinnere ? Vinnere ?
fixed fixed
🤷♂️ fixed 🤷♂️ fixed
|
||||
.then(res => res.json())
|
||||
|
Rename too Rename too `wineDeleted` and emit the wine element.
Vinnere ? Vinnere ?
fixed fixed
🤷♂️ fixed 🤷♂️ fixed
|
||||
requestNewWine(wine)
|
||||
|
Rename too Rename too `wineDeleted` and emit the wine element.
Vinnere ? Vinnere ?
fixed fixed
🤷♂️ fixed 🤷♂️ fixed
|
||||
},
|
||||
async deleteWine(wine) {
|
||||
if (window.confirm("Er du sikker på at du vil slette vinen?")) {
|
||||
|
||||
|
Rename too Rename too `wineDeleted` and emit the wine element.
Rename too Rename too `wineDeleted` and emit the wine element.
Vinnere ? Vinnere ?
Vinnere ? Vinnere ?
fixed fixed
fixed fixed
🤷♂️ fixed 🤷♂️ fixed
🤷♂️ fixed 🤷♂️ fixed
|
||||
Rename too
wineDeletedand emit the wine element.Rename too
wineDeletedand emit the wine element.Vinnere ?
Vinnere ?
fixed
fixed
🤷♂️ fixed
🤷♂️ fixed