Skip to content

Commit

Permalink
fix: or-2558 check if locatie is already present when appending
Browse files Browse the repository at this point in the history
  • Loading branch information
koenmetsu authored and janlesage committed Nov 21, 2024
1 parent d378adb commit fe8e4d3
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ public async Task AppendLocatie<T>(string id, ILocatie locatie) where T : class
id,
selector: u => u.Script(
s => s
.Source("ctx._source.locaties.add(params.item)")
.Source("if(! ctx._source.locaties.contains(params.item)){" +
"ctx._source.locaties.add(params.item)" +
"}")
.Params(objects => objects.Add(key: "item", locatie))));

if (!response.IsValid)
Expand Down

0 comments on commit fe8e4d3

Please sign in to comment.