Assure record value position for patch endpoint
This commit is contained in:
committed by
Kelani Tolulope
parent
2d174620fa
commit
bda9c72009
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user