🐛 Fix incorrect sorting in database relation field list due to premature pagination (#16425)

This commit is contained in:
Jeffrey Chen 2025-11-23 09:40:20 +08:00 committed by GitHub
parent ce9ef11af6
commit e9449952bd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1314,6 +1314,10 @@ func GetAttributeViewPrimaryKeyValues(avID, keyword string, page, pageSize int)
}
keyValues.Values = values
sort.Slice(keyValues.Values, func(i, j int) bool {
return keyValues.Values[i].Block.Updated > keyValues.Values[j].Block.Updated
})
if 1 > pageSize {
pageSize = 16
}
@ -1323,10 +1327,6 @@ func GetAttributeViewPrimaryKeyValues(avID, keyword string, page, pageSize int)
end = len(keyValues.Values)
}
keyValues.Values = keyValues.Values[start:end]
sort.Slice(keyValues.Values, func(i, j int) bool {
return keyValues.Values[i].Block.Updated > keyValues.Values[j].Block.Updated
})
return
}