diff --git a/FrontEnd/components/exhibition/ExhibitionListCard.vue b/FrontEnd/components/exhibition/ExhibitionListCard.vue index 1a999cc..05b9748 100644 --- a/FrontEnd/components/exhibition/ExhibitionListCard.vue +++ b/FrontEnd/components/exhibition/ExhibitionListCard.vue @@ -194,6 +194,8 @@ export default { ) .then((result) => { + this.$emit('toggle-favorite'); + }) .catch((err) => { console.log(err); diff --git a/FrontEnd/pages/user/saveExhibition.vue b/FrontEnd/pages/user/saveExhibition.vue index d1cb218..3ad5e46 100644 --- a/FrontEnd/pages/user/saveExhibition.vue +++ b/FrontEnd/pages/user/saveExhibition.vue @@ -77,11 +77,11 @@ > - + > @@ -305,8 +305,6 @@ export default { // patchData.LastName // ); // this.$store.dispatch("updatePicture"); - - }) .catch((error) => { console.log(error); @@ -390,7 +388,7 @@ export default { `/trending/api/Favorite/Favorites?Type=Exhibition` ) .then((response) => { - console.log(JSON.stringify(response)); + //console.log(JSON.stringify(response)); if(response && response.data && response.data.DATA && response.data.DATA.rel){ let data = response.data.DATA.rel if(data){ @@ -422,7 +420,7 @@ export default { `/trending/api/Exhibition/Cards?RegionIDs&CountryIDs&CityIDs&MainCategoryIDs&SubCategoryIDs&Status&Date&Sort&Lang=${this.$i18n.localeProperties["langQuery"]}` ) .then((response) => { - console.log(JSON.stringify(response)); + //console.log(JSON.stringify(response)); if(response && response.data && response.data.DATA && response.data.DATA.rel){ let data = response.data.DATA.rel if(data){ @@ -430,6 +428,7 @@ export default { this.exhibitionList.forEach((exhib) => { this.userSaveExhibition.forEach((user) => { if(exhib.ExhibitionID == user.ParentID){ + exhib.IsFavorite = 'Y'; this.showUserExhibitionList.push(exhib); } }) @@ -447,20 +446,13 @@ export default { // this.showUserExhibitionList.push(this.exhibitionMap.get(exhib.ExhibitionID)); // }) - - - - }; - - }; }) .catch((error) => { console.log(error); }); }, - filterSavedExhibition(countryId, selectId) { this.countryFilterList = []; @@ -489,8 +481,6 @@ export default { } }); - - // this.userSavedExhibitionPageLength = Math.ceil( // this.countryFilterList.length / this.savedExhibitionPerPage @@ -500,13 +490,22 @@ export default { }, async removeExhibitionRelation() { + // + this.countryFilterList = []; + this.exhibitionList = []; + this.userSaveExhibition = []; this.page = 1; - await this.fetchUserData(); + this.fetchUserData(); + await this.fetchSavedExhibition(); await this.fetchExhibition(); - this.countryFilterList = this.showUserExhibitionList; + + //this.countryFilterList = this.showUserExhibitionList; if (this.countrySelect.toString() !== "999") { this.countrySelect = 999; } + if (this.statusSelect.toString() !== "999") { + this.statusSelect = 999; + } }, }, };