A few more bug fixes (#3876)
Co-authored-by: Joseph Milazzo <joseph.v.milazzo@gmail.com>
This commit is contained in:
parent
4b9bbc5d78
commit
d909e03baf
21 changed files with 3940 additions and 45 deletions
|
|
@ -81,10 +81,6 @@ export class SeriesService {
|
|||
return this.httpClient.post<string>(this.baseUrl + 'series/delete-multiple', {seriesIds}, TextResonse).pipe(map(s => s === "true"));
|
||||
}
|
||||
|
||||
updateRating(seriesId: number, userRating: number) {
|
||||
return this.httpClient.post(this.baseUrl + 'series/update-rating', {seriesId, userRating});
|
||||
}
|
||||
|
||||
updateSeries(model: any) {
|
||||
return this.httpClient.post(this.baseUrl + 'series/update', model);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -78,6 +78,7 @@ export class ExternalRatingComponent implements OnInit {
|
|||
modalRef.componentInstance.userRating = this.userRating;
|
||||
modalRef.componentInstance.seriesId = this.seriesId;
|
||||
modalRef.componentInstance.hasUserRated = this.hasUserRated;
|
||||
modalRef.componentInstance.chapterId = this.chapterId;
|
||||
|
||||
modalRef.closed.subscribe((updated: {hasUserRated: boolean, userRating: number}) => {
|
||||
this.userRating = updated.userRating;
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import {Breakpoint} from "../../../shared/_services/utility.service";
|
|||
import {NgxStarsModule} from "ngx-stars";
|
||||
import {ThemeService} from "../../../_services/theme.service";
|
||||
import {SeriesService} from "../../../_services/series.service";
|
||||
import {ReviewService} from "../../../_services/review.service";
|
||||
|
||||
@Component({
|
||||
selector: 'app-rating-modal',
|
||||
|
|
@ -20,7 +21,7 @@ export class RatingModalComponent {
|
|||
|
||||
protected readonly modal = inject(NgbActiveModal);
|
||||
protected readonly themeService = inject(ThemeService);
|
||||
protected readonly seriesService = inject(SeriesService);
|
||||
protected readonly reviewService = inject(ReviewService);
|
||||
protected readonly cdRef = inject(ChangeDetectorRef);
|
||||
|
||||
protected readonly Breakpoint = Breakpoint;
|
||||
|
|
@ -28,14 +29,16 @@ export class RatingModalComponent {
|
|||
@Input({required: true}) userRating!: number;
|
||||
@Input({required: true}) seriesId!: number;
|
||||
@Input({required: true}) hasUserRated!: boolean;
|
||||
@Input() chapterId: number | undefined;
|
||||
starColor = this.themeService.getCssVariable('--rating-star-color');
|
||||
|
||||
|
||||
updateRating(rating: number) {
|
||||
this.seriesService.updateRating(this.seriesId, rating).subscribe(() => {
|
||||
this.reviewService.updateRating(this.seriesId, rating, this.chapterId).subscribe(() => {
|
||||
this.userRating = rating;
|
||||
this.hasUserRated = true;
|
||||
this.cdRef.markForCheck();
|
||||
this.close();
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -190,7 +190,7 @@ export class FilterUtilitiesService {
|
|||
switch (type) {
|
||||
case 'series':
|
||||
return [
|
||||
FilterField.SeriesName, FilterField.Summary, FilterField.Path, FilterField.FilePath, PersonFilterField.Name
|
||||
FilterField.SeriesName, FilterField.Summary, FilterField.Path, FilterField.FilePath
|
||||
] as unknown as T[];
|
||||
case 'person':
|
||||
return [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue