add method to delete board
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user