3
0

Assure record value position for patch endpoint

This commit is contained in:
Tomaž Jerman
2023-02-28 14:59:47 +01:00
committed by Kelani Tolulope
parent 2d174620fa
commit bda9c72009

View File

@@ -238,6 +238,12 @@ func (ctrl *Record) Patch(ctx context.Context, req *request.RecordPatch) (interf
oo := make([]*types.RecordBulkOperation, 0)
counters := make(map[string]uint)
for _, v := range req.Values {
v.Place = counters[v.Name]
counters[v.Name]++
}
for _, r := range req.Records {
oo = append(oo, &types.RecordBulkOperation{
RecordID: cast.ToUint64(r),