Browse Source

feat: support view column reorder

pull/6513/head
DarkPhoenix2704 1 year ago committed by sreehari jayaraj
parent
commit
538239a349
  1. 15
      packages/nocodb/src/models/Column.ts

15
packages/nocodb/src/models/Column.ts

@ -925,7 +925,7 @@ export default class Column<T = any> implements ColumnType {
static async update(
colId: string,
column: Partial<Column>,
column: Partial<Column> & Partial<Pick<ColumnReqType, 'column_order'>>,
ncMeta = Noco.ncMeta,
) {
const oldCol = await Column.get({ colId }, ncMeta);
@ -1079,6 +1079,19 @@ export default class Column<T = any> implements ColumnType {
await Column.delete(barcodeCol.fk_column_id, ncMeta);
}
}
if (column.column_order.order && column.column_order.view_id) {
const viewColumn = (
await View.getColumns(column.column_order.view_id)
).find((col) => col.fk_column_id === column.id);
const res = await View.updateColumn(
column.column_order.view_id,
viewColumn.id,
{
order: column.column_order.order,
},
);
console.log(res);
}
// get existing cache
const key = `${CacheScope.COLUMN}:${colId}`;

Loading…
Cancel
Save