diff --git a/src/app/components/mnoe-api/marketplace.svc.coffee b/src/app/components/mnoe-api/marketplace.svc.coffee index 5a6a2211..336da8cd 100644 --- a/src/app/components/mnoe-api/marketplace.svc.coffee +++ b/src/app/components/mnoe-api/marketplace.svc.coffee @@ -22,6 +22,9 @@ return marketplacePromise if marketplacePromise? marketplacePromise = marketplaceApi.get() + @clearApps = -> + marketplacePromise = null + MnoeObservables.registerCb(OBS_KEYS.marketplaceChanged, refreshApps) return @ diff --git a/src/app/views/products/modals/delete-modal-controller.coffee b/src/app/views/products/modals/delete-modal-controller.coffee index e8823d7a..b7c2e99a 100644 --- a/src/app/views/products/modals/delete-modal-controller.coffee +++ b/src/app/views/products/modals/delete-modal-controller.coffee @@ -1,4 +1,4 @@ -@App.controller 'DeleteProductController', ($uibModalInstance, MnoeProducts, product) -> +@App.controller 'DeleteProductController', ($uibModalInstance, MnoeProducts, product, MnoeMarketplace) -> 'ngInject' vm = this @@ -12,6 +12,7 @@ vm.modal.loading = true MnoeProducts.remove(vm.product.id).then( (success) -> + MnoeMarketplace.clearApps() $uibModalInstance.close(true) ).finally(-> vm.modal.loading = false) diff --git a/src/app/views/products/product.controller.coffee b/src/app/views/products/product.controller.coffee index 1423b863..499b0fd8 100644 --- a/src/app/views/products/product.controller.coffee +++ b/src/app/views/products/product.controller.coffee @@ -1,4 +1,4 @@ -@App.controller 'ProductController', ($stateParams, $state, $timeout, $document, Upload, MnoeProducts, toastr, MnoErrorsHandler, CURRENCIES, MnoeCurrentUser, UserRoles) -> +@App.controller 'ProductController', ($stateParams, $state, $timeout, $document, Upload, MnoeProducts, toastr, MnoErrorsHandler, CURRENCIES, MnoeCurrentUser, UserRoles, MnoeMarketplace) -> 'ngInject' vm = this @@ -159,6 +159,7 @@ vm.product.values_attributes = _.map(_.keys(vm.product.values_display), (k) -> {name: k, data: vm.product.values_display[k]}) vm.product.patch(_.pick(vm.product, params)).then( (response) -> + MnoeMarketplace.clearApps() toastr.success('mnoe_admin_panel.dashboard.product.success', {extraData: {product: vm.product.name}}) response (error) ->