Browse Source

Schema name placeholder to constant.

pull/237/head
Sebastian Stehle 8 years ago
parent
commit
5e5cb19714
  1. 3
      src/Squidex.Domain.Apps.Core.Operations/HandleRules/Actions/AlgoliaActionHandler.cs

3
src/Squidex.Domain.Apps.Core.Operations/HandleRules/Actions/AlgoliaActionHandler.cs

@ -22,6 +22,7 @@ namespace Squidex.Domain.Apps.Core.HandleRules.Actions
{ {
public sealed class AlgoliaActionHandler : RuleActionHandler<AlgoliaAction> public sealed class AlgoliaActionHandler : RuleActionHandler<AlgoliaAction>
{ {
private const string SchemaNamePlaceholder = "$SCHEMA_NAME";
private readonly ConcurrentDictionary<(string AppId, string ApiKey, string IndexName), Index> clients = new ConcurrentDictionary<(string AppId, string ApiKey, string IndexName), Index>(); private readonly ConcurrentDictionary<(string AppId, string ApiKey, string IndexName), Index> clients = new ConcurrentDictionary<(string AppId, string ApiKey, string IndexName), Index>();
private readonly JsonSerializer serializer; private readonly JsonSerializer serializer;
@ -45,7 +46,7 @@ namespace Squidex.Domain.Apps.Core.HandleRules.Actions
{ {
ruleData["ContentId"] = contentEvent.ContentId.ToString(); ruleData["ContentId"] = contentEvent.ContentId.ToString();
ruleData["Operation"] = "Upsert"; ruleData["Operation"] = "Upsert";
ruleData["IndexName"] = action.IndexName.Replace("$SCHEMA_NAME", contentEvent.SchemaId.Name); ruleData["IndexName"] = action.IndexName.Replace(SchemaNamePlaceholder, contentEvent.SchemaId.Name);
var timestamp = @event.Headers.Timestamp().ToString(); var timestamp = @event.Headers.Timestamp().ToString();

Loading…
Cancel
Save