From b22e08b1eba6b3e298da18665a0cb19f77f46fa1 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 20 Jul 2025 19:59:21 +0300 Subject: [PATCH] refactor(views/board): use bulk API for renaming columns --- .../src/widgets/view_widgets/board_view/api.ts | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/apps/client/src/widgets/view_widgets/board_view/api.ts b/apps/client/src/widgets/view_widgets/board_view/api.ts index 7a706f2e6..ffec13960 100644 --- a/apps/client/src/widgets/view_widgets/board_view/api.ts +++ b/apps/client/src/widgets/view_widgets/board_view/api.ts @@ -55,18 +55,22 @@ export default class BoardApi { } async renameColumn(oldValue: string, newValue: string, noteIds: string[]) { + // Change the value in the notes. + await executeBulkActions(noteIds, [ + { + name: "updateLabelValue", + labelName: "status", + labelValue: newValue + } + ]); + // Rename the column in the persisted data. for (const column of this.persistedData.columns || []) { if (column.value === oldValue) { column.value = newValue; } } - this.viewStorage.store(this.persistedData); - - // Update all notes that have the old status value to the new value - for (const noteId of noteIds) { - await attributes.setLabel(noteId, "status", newValue); - } + await this.viewStorage.store(this.persistedData); } async removeColumn(column: string) {