file upload

This commit is contained in:
2019-12-16 21:58:03 +01:00
committed by smuddy
parent 8aeffc3c8f
commit ea24d1fbb3
25 changed files with 1887 additions and 505 deletions

View File

@@ -0,0 +1,19 @@
import {Injectable} from '@angular/core';
import {SongDataService} from './song-data.service';
import {File} from './file';
@Injectable({
providedIn: 'root'
})
export class FileDataService {
constructor(private songDataService: SongDataService) {
}
public async put(songId: string, file: File): Promise<string> {
const songRef = this.songDataService.getSongRef(songId);
const fileCollection = songRef.collection('files');
const id = await fileCollection.add(file);
return id.id;
}
}