Skip to content

Commit 5dcce0d

Browse files
committed
Edit index bug fix and handler updates.
1 parent 453c409 commit 5dcce0d

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/Umbraco.Cms.Integrations.Search.Algolia/App_Plugins/UmbracoCms.Integrations/Search/Algolia/js/algolia.resource.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
$http.get(`${apiEndpoint}/GetIndices`),
1010
"Failed");
1111
},
12-
saveIndex: function (name, contentData) {
12+
saveIndex: function (id, name, contentData) {
1313
return umbRequestHelper.resourcePromise(
14-
$http.post(`${apiEndpoint}/SaveIndex`, { name: name, contentData: contentData }),
14+
$http.post(`${apiEndpoint}/SaveIndex`, { id: id, name: name, contentData: contentData }),
1515
"Failed");
1616
},
1717
buildIndex: function (id) {

src/Umbraco.Cms.Integrations.Search.Algolia/App_Plugins/UmbracoCms.Integrations/Search/Algolia/js/dashboard.controller.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,13 @@
138138
vm.loading = true;
139139

140140
umbracoCmsIntegrationsSearchAlgoliaResource
141-
.saveIndex(vm.manageIndex.name, vm.manageIndex.contentData)
141+
.saveIndex(vm.manageIndex.id, vm.manageIndex.name, vm.manageIndex.contentData)
142142
.then(function (response) {
143143
if (response.success) {
144144
vm.manageIndex.reset();
145145
algoliaService.getContentTypes((response) => vm.manageIndex.contentTypes = response);
146146
} else {
147-
notificationsService.error(response);
147+
notificationsService.error(response.error);
148148
}
149149

150150
vm.viewState = "list";

src/Umbraco.Cms.Integrations.Search.Algolia/Handlers/BaseContentHandler.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public BaseContentHandler(ILogger<BaseContentHandler> logger,
2828
IndexService = indexService;
2929
}
3030

31-
public async Task RebuildIndex(IEnumerable<IContent> entities, bool deleteIndexData = false)
31+
protected async Task RebuildIndex(IEnumerable<IContent> entities, bool deleteIndexData = false)
3232
{
3333
try
3434
{
@@ -51,13 +51,13 @@ public async Task RebuildIndex(IEnumerable<IContent> entities, bool deleteIndexD
5151
: await IndexService.UpdateData(index.Name, record);
5252

5353
if (result.Failure)
54-
Logger.LogError($"Failed to delete data for Algolia index: {result}");
54+
Logger.LogError($"Failed to update data for Algolia index: {result}");
5555
}
5656
}
5757
}
5858
catch (Exception ex)
5959
{
60-
Logger.LogError($"Failed to delete data for Algolia index: {ex.Message}");
60+
Logger.LogError($"Failed to update data for Algolia index: {ex.Message}");
6161
}
6262
}
6363
}

0 commit comments

Comments
 (0)