From 897e274905d372ddee3fcabe15ee855c1b4b60ef Mon Sep 17 00:00:00 2001
From: Mateja <mail@matejamaric.com>
Date: Mon, 26 Jul 2021 15:04:35 +0200
Subject: Add back button to product page.

---
 client/src/views/Product.vue | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

(limited to 'client/src/views/Product.vue')

diff --git a/client/src/views/Product.vue b/client/src/views/Product.vue
index d1fde29..142fb42 100644
--- a/client/src/views/Product.vue
+++ b/client/src/views/Product.vue
@@ -14,9 +14,10 @@
             <p class="card-text" v-text="curProduct.description"></p>
             <p class="card-text"><small class="text-muted">Amount: {{curProductQuantity}}</small></p>
           </div>
-          <div class="card-footer">
+          <div class="card-footer d-flex align-items-baseline">
             <div class="btn btn-dark" @click="buy">Add to cart</div>
             <div class="btn btn-secondary ms-3" v-show="curProductQuantity" @click="remove">Remove from cart</div>
+            <div class="btn btn-outline-secondary btn-sm ms-auto" @click="back">Go back</div>
           </div>
         </div>
 
@@ -48,6 +49,9 @@ export default {
     },
     remove() {
       this.$store.commit('removeFromCart', this.$route.params.id);
+    },
+    back() {
+      this.$router.back();
     }
   }
 }
-- 
cgit v1.2.3

