Browse Source

Replace index name with schema name.

pull/237/head
Sebastian Stehle 8 years ago
parent
commit
0566a4f8cb
  1. 4
      src/Squidex.Domain.Apps.Core.Operations/HandleRules/Actions/AlgoliaActionHandler.cs
  2. 2
      src/Squidex/app/features/rules/pages/rules/actions/algolia-action.component.html

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

@ -38,14 +38,14 @@ namespace Squidex.Domain.Apps.Core.HandleRules.Actions
var ruleData = new RuleJobData var ruleData = new RuleJobData
{ {
["AppId"] = action.AppId, ["AppId"] = action.AppId,
["ApiKey"] = action.ApiKey, ["ApiKey"] = action.ApiKey
["IndexName"] = action.IndexName
}; };
if (@event.Payload is ContentEvent contentEvent) if (@event.Payload is ContentEvent contentEvent)
{ {
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);
var timestamp = @event.Headers.Timestamp().ToString(); var timestamp = @event.Headers.Timestamp().ToString();

2
src/Squidex/app/features/rules/pages/rules/actions/algolia-action.component.html

@ -36,7 +36,7 @@
<input type="text" class="form-control" id="indexName" formControlName="indexName" /> <input type="text" class="form-control" id="indexName" formControlName="indexName" />
<small class="form-text text-muted"> <small class="form-text text-muted">
The name of the index. Use $SCHEMA_NAME as a placeholder The name of the index. Use $SCHEMA_NAME as a placeholder.
</small> </small>
</div> </div>
</div> </div>

Loading…
Cancel
Save