From ca6f6cb2baab9ced51267c779db711b59fb0fe90 Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Mon, 11 Jan 2021 20:54:48 +0100 Subject: [PATCH] Request new wine response includes success bool. Displays alert instead of modal if not true. --- frontend/components/RequestWine.vue | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/frontend/components/RequestWine.vue b/frontend/components/RequestWine.vue index 432a743..7b1fb61 100644 --- a/frontend/components/RequestWine.vue +++ b/frontend/components/RequestWine.vue @@ -83,7 +83,13 @@ export default { }, request(wine){ requestNewWine(wine) - .then(() => this.showModal = true) + .then(resp => { + if(resp.success) { + this.showModal = true + } else { + alert("Obs, her oppsto det en feil! Feilen er logget."); + } + }) }, emitFromModalButton(action){ if(action == "stay"){