fix file delete
This commit is contained in:
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "wgenerator",
|
"name": "wgenerator",
|
||||||
"version": "0.0.0",
|
"version": "1.0",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "wgenerator",
|
"name": "wgenerator",
|
||||||
"version": "0.0.0",
|
"version": "1.0",
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@angular/animations": "^13.3.1",
|
"@angular/animations": "^13.3.1",
|
||||||
|
|||||||
@@ -14,9 +14,9 @@ export class FileService {
|
|||||||
return ref.getDownloadURL() as Observable<string>;
|
return ref.getDownloadURL() as Observable<string>;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async delete(path: string, songId: string, fileId: string): Promise<void> {
|
public delete(path: string, songId: string, fileId: string): void {
|
||||||
const ref = this.storage.ref(path);
|
const ref = this.storage.ref(path);
|
||||||
await firstValueFrom(ref.delete());
|
void firstValueFrom(ref.delete());
|
||||||
await this.fileDataService.delete(songId, fileId);
|
void this.fileDataService.delete(songId, fileId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ export class FileComponent {
|
|||||||
this.path = file.path + '/' + file.name;
|
this.path = file.path + '/' + file.name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async onDelete(): Promise<void> {
|
public onDelete(): void {
|
||||||
if (this.path && this.songId && this.fileId) await this.fileService.delete(this.path, this.songId, this.fileId);
|
if (this.path && this.songId && this.fileId) this.fileService.delete(this.path, this.songId, this.fileId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user