chore(views/board): delete values when deleting column

This commit is contained in:
Elian Doran
2025-07-20 19:51:03 +03:00
parent 9e936cb57b
commit 2b5029cc38
4 changed files with 22 additions and 12 deletions

View File

@@ -1,6 +1,7 @@
import appContext from "../../../components/app_context";
import FNote from "../../../entities/fnote";
import attributes from "../../../services/attributes";
import bulk_action, { executeBulkActions } from "../../../services/bulk_action";
import note_create from "../../../services/note_create";
import ViewModeStorage from "../view_mode_storage";
import { BoardData } from "./config";
@@ -69,6 +70,15 @@ export default class BoardApi {
}
async removeColumn(column: string) {
// Remove the value from the notes.
const noteIds = this.byColumn.get(column)?.map(item => item.note.noteId) || [];
await executeBulkActions(noteIds, [
{
name: "deleteLabel",
labelName: "status"
}
]);
this.persistedData.columns = (this.persistedData.columns ?? []).filter(col => col.value !== column);
this.viewStorage.store(this.persistedData);
}