Added one request per column on board. (#5819)
- Changed to one find many request per column on board.
This commit is contained in:
@ -0,0 +1,19 @@
|
||||
import { ObjectRecord } from '@/object-record/types/ObjectRecord';
|
||||
|
||||
export const sortRecordsByPosition = (
|
||||
record1: ObjectRecord,
|
||||
record2: ObjectRecord,
|
||||
) => {
|
||||
if (
|
||||
typeof record1.position == 'number' &&
|
||||
typeof record2.position == 'number'
|
||||
) {
|
||||
return record1.position - record2.position;
|
||||
} else if (record1.position === 'first' || record2.position === 'last') {
|
||||
return -1;
|
||||
} else if (record2.position === 'first' || record1.position === 'last') {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user