transform keys and text service

This commit is contained in:
2020-03-16 21:07:11 +01:00
committed by smuddy
parent 8c000867cb
commit 7d58dd9bdd
18 changed files with 335 additions and 36 deletions

View File

@@ -2,17 +2,23 @@ import {Injectable} from '@angular/core';
import {ShowSongDataService} from './show-song-data.service';
import {Observable} from 'rxjs';
import {ShowSong} from './showSong';
import {SongDataService} from '../../songs/services/song-data.service';
import {take} from 'rxjs/operators';
@Injectable({
providedIn: 'root'
})
export class ShowSongService {
constructor(private showSongDataService: ShowSongDataService) {
constructor(
private showSongDataService: ShowSongDataService,
private songDataService: SongDataService
) {
}
public async new$(showId: string, songId: string, order: number): Promise<string> {
const data = {songId, order};
const song = await this.songDataService.read$(songId).pipe(take(1)).toPromise();
const data = {songId, order, key: song.key, keyOriginal: song.key};
return await this.showSongDataService.add(showId, data);
}

View File

@@ -1,5 +1,7 @@
export interface ShowSong {
id: string;
songId: string;
key: string;
keyOriginal: string;
order: number;
}