3
0

Add missing values to record Organize filter construction

Previous version defaulted filter's module and namespace references
if not provided; the new one does not which would cause all the
records to be used.
This commit is contained in:
Tomaž Jerman
2022-07-27 15:43:04 +02:00
parent 1ddb770f39
commit 8e5ffab785

View File

@@ -1291,7 +1291,10 @@ func (svc record) Organize(ctx context.Context, namespaceID, moduleID, recordID
// We are interested only in records that have value of a sorting field greater than
// the place we're moving our record to.
// and sort the set with sorting field
reorderFilter := types.RecordFilter{}
reorderFilter := types.RecordFilter{
ModuleID: moduleID,
NamespaceID: namespaceID,
}
reorderFilter.Query = fmt.Sprintf("%s(%s >= %d)", filter, posField, recordOrderPlace)
if err = reorderFilter.Sort.Set(posField); err != nil {
return err