update angular version

This commit is contained in:
2022-02-13 21:32:19 +01:00
parent 02c1a635b6
commit a5adbc2fb1
25 changed files with 14022 additions and 21748 deletions

View File

@@ -1,9 +1,8 @@
import {Injectable} from '@angular/core';
import {ShowSongDataService} from './show-song-data.service';
import {Observable} from 'rxjs';
import {firstValueFrom, Observable} from 'rxjs';
import {ShowSong} from './show-song';
import {SongDataService} from '../../songs/services/song-data.service';
import {first, take} from 'rxjs/operators';
import {UserService} from '../../../services/user/user.service';
import {ShowService} from './show.service';
@@ -19,8 +18,8 @@ export class ShowSongService {
) {}
public async new$(showId: string, songId: string, addedLive = false): Promise<string | null> {
const song = await this.songDataService.read$(songId).pipe(take(1)).toPromise();
const user = await this.userService.user$.pipe(take(1)).toPromise();
const song = await firstValueFrom(this.songDataService.read$(songId));
const user = await firstValueFrom(this.userService.user$);
if (!song || !user) return null;
const data: Partial<ShowSong> = {
...song,
@@ -34,14 +33,14 @@ export class ShowSongService {
}
public read$ = (showId: string, songId: string): Observable<ShowSong | null> => this.showSongDataService.read$(showId, songId);
public read = (showId: string, songId: string): Promise<ShowSong | null> => this.read$(showId, songId).pipe(first()).toPromise();
public read = (showId: string, songId: string): Promise<ShowSong | null> => firstValueFrom(this.read$(showId, songId));
public list$ = (showId: string): Observable<ShowSong[]> => this.showSongDataService.list$(showId);
public list = (showId: string): Promise<ShowSong[]> => this.list$(showId).pipe(first()).toPromise();
public list = (showId: string): Promise<ShowSong[]> => firstValueFrom(this.list$(showId));
public async delete$(showId: string, songId: string, index: number): Promise<void> {
await this.showSongDataService.delete(showId, songId);
const show = await this.showService.read$(showId).pipe(first()).toPromise();
const show = await firstValueFrom(this.showService.read$(showId));
if (!show) return;
const order = show.order;
order.splice(index, 1);