-
+
+
Добро пожаловать в
Wishlist,
{{ userStore.user['name'] }}
Гость
+
+
Добро пожаловать в
+
Wishlist, {{ isAuthenticated ? userStore.user['name'] : 'Гость' }}!
+
Выйти
-
+
diff --git a/resources/views/PublicWishlist/ShowWhishlist.vue b/resources/views/PublicWishlist/ShowWhishlist.vue
index a6691ac..be9ce40 100644
--- a/resources/views/PublicWishlist/ShowWhishlist.vue
+++ b/resources/views/PublicWishlist/ShowWhishlist.vue
@@ -33,6 +33,15 @@ export default {
closeBookDialog(){
this.bookConfirmationDialog = false;
},
+ updateFrontWishes(){
+ this.fetching = true;
+ let urlArray = window.location.href.split('/');
+ let user_id = urlArray[urlArray.length - 1];
+ this.wishStore.getUserWishes(user_id).then((res)=>{
+ this.wishes = res;
+ this.fetching = false;
+ });
+ },
book(){
this.bookLoading = true;
this.wishStore.book(this.bookItemId, this.userStore.user["id"], this.userStore.token).then((response)=>{
@@ -42,18 +51,17 @@ export default {
this.bookError = true;
} else {
this.bookConfirmationDialog = false;
- this.fetching = true;
- let urlArray = window.location.href.split('/');
- let user_id = urlArray[urlArray.length - 1];
- this.wishStore.getUserWishes(user_id).then((res)=>{
- this.wishes = res;
- this.fetching = false;
- });
+ this.updateFrontWishes();
}
this.bookLoading = false;
}).catch(()=>{
this.bookLoading = false;
});
+ },
+ unbook(id){
+ this.wishStore.unbook(id, this.userStore.token).then(()=>{
+ this.updateFrontWishes();
+ });
}
},
mounted() {
@@ -101,7 +109,8 @@ export default {
Забронировать
Нет
-
+ Да
+
@@ -132,10 +141,10 @@ export default {
Цена: {{ wish['price'] }}₽
Забронировано:
- Забронировать
+ Забронировать
Нет
- Да
+ Да
diff --git a/resources/views/Wishlist/Wishlist.vue b/resources/views/Wishlist/Wishlist.vue
index beb2867..4e0f00d 100644
--- a/resources/views/Wishlist/Wishlist.vue
+++ b/resources/views/Wishlist/Wishlist.vue
@@ -60,6 +60,11 @@ export default {
copyLink(){
navigator.clipboard.writeText(this.wishlistLink);
this.snackbar = true;
+ },
+ unbook(id){
+ this.wishStore.unbook(id, this.userStore.token).then(()=>{
+ this.updateFrontWishes();
+ });
}
}
}
@@ -96,7 +101,7 @@ export default {
{{ wish['name'] }} |
{{ wish['price'] }} |
{{ wish['url'] }} |
- {{ wish['book_user'] === null ? 'Нет' : wish['book_user']['name'] }} |
+ {{ wish['book_user'] === null ? 'Нет' : wish['book_user']['name'] }} |
|
|
@@ -124,7 +129,9 @@ export default {
Цена: {{ wish['price'] }}₽
- Забронировано: {{ wish['book_user'] === null ? 'Нет' : wish['book_user']['name'] }}
+ Забронировано: {{ wish['book_user'] === null ? 'Нет' : wish['book_user']['name'] }}
+
+
@@ -140,38 +147,6 @@ export default {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-