ui enhancements and song state
This commit is contained in:
@@ -141,11 +141,11 @@ export class DocxService {
|
||||
|
||||
private async prepareData(showId: string): Promise<{ songs: ({ showSong: ShowSong, song: Song, sections: Section[] })[]; show: Show, user: User }> {
|
||||
const show = await this.showService.read$(showId).pipe(first()).toPromise();
|
||||
const user = await this.userService.getUserbyId$(show.owner).pipe(first()).toPromise();
|
||||
const user = await this.userService.getUserbyId(show.owner);
|
||||
|
||||
const showSongs = await this.showSongService.list$(showId).pipe(first()).toPromise();
|
||||
const showSongs = await this.showSongService.list(showId);
|
||||
const songsAsync = await showSongs.map(async showSong => {
|
||||
const song = await this.songService.read(showSong.songId).pipe(first()).toPromise();
|
||||
const song = await this.songService.read(showSong.songId);
|
||||
const sections = this.textRenderingService.parse(song.text);
|
||||
return {
|
||||
showSong,
|
||||
|
||||
@@ -3,7 +3,7 @@ import {ShowSongDataService} from './show-song-data.service';
|
||||
import {Observable} from 'rxjs';
|
||||
import {ShowSong} from './show-song';
|
||||
import {SongDataService} from '../../songs/services/song-data.service';
|
||||
import {take} from 'rxjs/operators';
|
||||
import {first, take} from 'rxjs/operators';
|
||||
import {UserService} from '../../../services/user/user.service';
|
||||
|
||||
@Injectable({
|
||||
@@ -33,6 +33,7 @@ export class ShowSongService {
|
||||
}
|
||||
|
||||
public list$ = (showId: string): Observable<ShowSong[]> => this.showSongDataService.list$(showId, _ => _.orderBy('order'));
|
||||
public list = (showId: string): Promise<ShowSong[]> => this.list$(showId).pipe(first()).toPromise();
|
||||
public delete$ = (showId: string, songId: string): Promise<void> => this.showSongDataService.delete(showId, songId);
|
||||
public update$ = async (showId: string, songId: string, data: Partial<ShowSong>): Promise<void> => await this.showSongDataService.update$(showId, songId, data);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user