add method to delete board
This commit is contained in:
Vendored
+10
-1
@@ -536,7 +536,7 @@
|
||||
return this.fileModel.getModelContainerPath("taskModel");
|
||||
};
|
||||
getBoardFilePath = (boardId) => {
|
||||
return [...this.fileModel.getFilePath(boardId), boardId];
|
||||
return [...this.fileModel.getFilePath(boardId)];
|
||||
};
|
||||
getBoardContainerPath = () => {
|
||||
return [...this.getBasePath(), subDirectories.boards];
|
||||
@@ -590,6 +590,14 @@
|
||||
);
|
||||
this.storageModel.write(boardDirectoryPath, "");
|
||||
};
|
||||
deleteBoard = (boardId) => {
|
||||
const boardFilePath = this.getBoardFilePath(boardId);
|
||||
const boardDirectoryPath = this.getBoardDirectoryPath(boardId);
|
||||
console.log(boardFilePath);
|
||||
console.log(boardDirectoryPath);
|
||||
this.storageModel.removeRecursively(boardFilePath);
|
||||
this.storageModel.removeRecursively(boardDirectoryPath);
|
||||
};
|
||||
//tasks
|
||||
createTask = (boardId, name) => {
|
||||
const taskFileVersion = _TaskModel.createTaskFileVersion(
|
||||
@@ -764,6 +772,7 @@
|
||||
"coral" /* Coral */
|
||||
);
|
||||
this.taskModel.createOrUpdateBoard(newInfo);
|
||||
setTimeout(() => this.taskModel.deleteBoard(boardId), 7e3);
|
||||
}
|
||||
// utility
|
||||
static generateFileVersionId = (creationDate) => {
|
||||
|
||||
Reference in New Issue
Block a user