Added one request per column on board. (#5819)

- Changed to one find many request per column on board.
This commit is contained in:
Lucas Bordeau
2024-06-11 12:29:33 +02:00
committed by GitHub
parent 9307d206c5
commit 25a38dc693
10 changed files with 287 additions and 60 deletions

View File

@ -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;
}
};