delete file button

This commit is contained in:
2020-06-11 19:56:47 +02:00
parent ff4f081e7c
commit bcbd119fbd
11 changed files with 92 additions and 36 deletions

View File

@@ -20,6 +20,11 @@ export class FileDataService {
return id.id;
}
public async delete(songId: string, fileId: string): Promise<void> {
const fileRef = this.db.doc('songs/' + songId + '/files/' + fileId);
await fileRef.delete();
}
public read$(songId: string): Observable<File[]> {
const songRef = this.db.doc('songs/' + songId);
return songRef.collection<File>('files').snapshotChanges().pipe(map(actions => {