delete song
This commit is contained in:
@@ -15,6 +15,8 @@ export class SongDataService {
|
||||
public list$ = (): Observable<Song[]> => this.dbService.col$(this.collection);
|
||||
public read$ = (songId: string): Observable<Song | undefined> => this.dbService.doc$(this.collection + '/' + songId);
|
||||
public update$ = async (songId: string, data: Partial<Song>): Promise<void> => await this.dbService.doc(this.collection + '/' + songId).update(data);
|
||||
public add = async (data: Partial<Song>): Promise<string> => (await this.dbService.col(this.collection).add(data)).id
|
||||
public add = async (data: Partial<Song>): Promise<string> => (await this.dbService.col(this.collection).add(data)).id;
|
||||
public delete = async (songId: string): Promise<void> => await this.dbService.doc(this.collection + '/' + songId).delete();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,6 @@ export class SongService {
|
||||
public static LEGAL_OWNER = ['CCLI', 'other'];
|
||||
public static LEGAL_TYPE = ['open', 'allowed'];
|
||||
|
||||
|
||||
private list: Song[];
|
||||
|
||||
constructor(private songDataService: SongDataService) {
|
||||
@@ -36,6 +35,10 @@ export class SongService {
|
||||
return await this.songDataService.add({number, title, status: 'draft', legalType: 'open'})
|
||||
}
|
||||
|
||||
public async delete(songId: string): Promise<void> {
|
||||
await this.songDataService.delete(songId);
|
||||
}
|
||||
|
||||
// https://www.csvjson.com/csv2json
|
||||
private async updateFromCLI(songs: Song[]) {
|
||||
const mapped = songs.map(_ => ({
|
||||
|
||||
Reference in New Issue
Block a user