From c7f8b3c18a8d18657d124982449968c8a0458ac4 Mon Sep 17 00:00:00 2001 From: patrickdemooij9 Date: Fri, 8 Jul 2022 21:43:27 +0200 Subject: [PATCH] Fix for save not always working (#95) * Fix for save not always working * Revert notification --- .../DocumentType/seoSettings.controller.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/SeoToolkit.Umbraco.Common/App_Plugins/SeoToolkit/ContentApps/DocumentType/seoSettings.controller.js b/src/SeoToolkit.Umbraco.Common/App_Plugins/SeoToolkit/ContentApps/DocumentType/seoSettings.controller.js index 5eaa15f8..83566211 100644 --- a/src/SeoToolkit.Umbraco.Common/App_Plugins/SeoToolkit/ContentApps/DocumentType/seoSettings.controller.js +++ b/src/SeoToolkit.Umbraco.Common/App_Plugins/SeoToolkit/ContentApps/DocumentType/seoSettings.controller.js @@ -43,7 +43,7 @@ } function save() { - $http.post("backoffice/SeoToolkit/SeoSettings/Set", + return $http.post("backoffice/SeoToolkit/SeoSettings/Set", { contentTypeId: $scope.model.id, enabled: vm.model.enableSeoSettings @@ -58,11 +58,11 @@ $scope.$on("formSubmitting", function () { - save(); - - if (vm.model.enableSeoSettings) { - $scope.$broadcast("seoSettingsSubmitting"); - } + save().then(function() { + if (vm.model.enableSeoSettings) { + $scope.$broadcast("seoSettingsSubmitting"); + } + }); }); init();