refactor(collections/board): use API to reorder column

This commit is contained in:
Elian Doran
2025-09-12 17:39:52 +03:00
parent a08bc79ae4
commit f300b6c8a2
3 changed files with 19 additions and 98 deletions

View File

@@ -99,6 +99,23 @@ export default class BoardApi {
this.saveConfig(this.viewConfig);
}
reorderColumn(fromIndex: number, toIndex: number) {
if (!this.columns || fromIndex === toIndex) return;
const newColumns = [...this.columns];
const [movedColumn] = newColumns.splice(fromIndex, 1);
newColumns.splice(toIndex, 0, movedColumn);
// Update view config with new column order
const newViewConfig = {
...this.viewConfig,
columns: newColumns.map(col => ({ value: col }))
};
this.saveConfig(newViewConfig);
return newColumns;
}
async insertRowAtPosition(
column: string,
relativeToBranchId: string,