add method to delete board

This commit is contained in:
marlon-erler
2024-07-22 18:09:58 +02:00
parent 3cc961a82b
commit 8a3b63ea7c
3 changed files with 38 additions and 2 deletions
+9 -1
View File
@@ -22,7 +22,7 @@ export default class TaskModel {
};
getBoardFilePath = (boardId: string): string[] => {
return [...this.fileModel.getFilePath(boardId), boardId];
return [...this.fileModel.getFilePath(boardId)];
};
getBoardContainerPath = (): string[] => {
@@ -102,6 +102,14 @@ export default class TaskModel {
this.storageModel.write(boardDirectoryPath, "");
};
deleteBoard = (boardId: string): void => {
const boardFilePath: string[] = this.getBoardFilePath(boardId);
const boardDirectoryPath: string[] = this.getBoardDirectoryPath(boardId);
this.storageModel.removeRecursively(boardFilePath);
this.storageModel.removeRecursively(boardDirectoryPath);
};
//tasks
createTask = (boardId: string, name: string): void => {
const taskFileVersion: TaskFileVersion = TaskModel.createTaskFileVersion(