mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 14:40:12 +01:00
🎨 https://github.com/siyuan-note/siyuan/issues/5066 removeData
This commit is contained in:
parent
7c7f3db0b8
commit
fdf9f0d9e4
1 changed files with 12 additions and 0 deletions
|
|
@ -109,6 +109,18 @@ export class Plugin {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public removeData(storageName: string) {
|
||||||
|
return new Promise((resolve) => {
|
||||||
|
if (!this.data) {
|
||||||
|
this.data = {};
|
||||||
|
}
|
||||||
|
fetchPost("/api/file/removeFile", {path: `/data/storage/petal/${this.name}/${storageName}`}, (response) => {
|
||||||
|
delete this.data[storageName];
|
||||||
|
resolve(response);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
public addTab(options: {
|
public addTab(options: {
|
||||||
type: string,
|
type: string,
|
||||||
destroy?: () => void,
|
destroy?: () => void,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue