fetch search index change settings

This commit is contained in:
usmannasir
2025-04-07 15:24:12 +05:00
parent 171947c6c4
commit 5aac3594b0
2 changed files with 9 additions and 19 deletions

View File

@@ -680,15 +680,11 @@ app.controller('WPsiteHome', function ($scope, $http, $timeout, $compile, $windo
PPPassword: '', PPPassword: '',
} }
} }
} else if (setting === 'search-indexing') {
var data = {
WPid: $('#WPid').html(),
setting: setting,
settingValue: $scope.searchIndexEnabled ? 1 : 0
}
} else { } else {
var settingValue = 0; var settingValue = 0;
if ($('#' + setting).is(":checked")) { if (setting === 'searchIndex') {
settingValue = $scope.searchIndexEnabled ? 1 : 0;
} else if ($('#' + setting).is(":checked")) {
settingValue = 1; settingValue = 1;
} }
var data = { var data = {
@@ -704,10 +700,8 @@ app.controller('WPsiteHome', function ($scope, $http, $timeout, $compile, $windo
} }
}; };
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas); $http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
function ListInitialDatas(response) { function ListInitialDatas(response) {
$scope.wordpresshomeloading = true; $scope.wordpresshomeloading = true;
$('#wordpresshomeloading').hide(); $('#wordpresshomeloading').hide();
@@ -4285,15 +4279,11 @@ app.controller('WPsiteHome', function ($scope, $http, $timeout, $compile, $windo
} }
} else if (setting === 'search-indexing') {
var data = {
WPid: $('#WPid').html(),
setting: setting,
settingValue: $scope.searchIndexEnabled ? 1 : 0
}
} else { } else {
var settingValue = 0; var settingValue = 0;
if ($('#' + setting).is(":checked")) { if (setting === 'searchIndex') {
settingValue = $scope.searchIndexEnabled ? 1 : 0;
} else if ($('#' + setting).is(":checked")) {
settingValue = 1; settingValue = 1;
} }
var data = { var data = {

View File

@@ -241,11 +241,11 @@
<div class="col-md-3"> <div class="col-md-3">
<h6 style="font-weight: bold">Search Engine Indexing</h6> <h6 style="font-weight: bold">Search Engine Indexing</h6>
<div class="custom-control custom-switch"> <div class="custom-control custom-switch">
<input ng-click="UpdateWPSettings('search-indexing')" <input type="checkbox"
type="checkbox"
class="custom-control-input" class="custom-control-input"
id="searchIndex" id="searchIndex"
ng-model="searchIndexEnabled"> ng-model="searchIndexEnabled"
ng-change="UpdateWPSettings('searchIndex')">
<label class="custom-control-label" <label class="custom-control-label"
for="searchIndex"></label> for="searchIndex"></label>
</div> </div>