Add rating to chapter page & volume (if one chapter)
This commit is contained in:
parent
e96cb0fde9
commit
8ccc2b5801
18 changed files with 226 additions and 47 deletions
|
|
@ -4,6 +4,7 @@ import { HttpClient } from "@angular/common/http";
|
|||
import {Chapter} from "../_models/chapter";
|
||||
import {TextResonse} from "../_types/text-response";
|
||||
import {UserReview} from "../_single-module/review-card/user-review";
|
||||
import {Rating} from "../_models/rating";
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
|
|
@ -35,11 +36,19 @@ export class ChapterService {
|
|||
}
|
||||
|
||||
updateChapterReview(seriesId: number, chapterId: number, body: string, rating: number) {
|
||||
return this.httpClient.post<UserReview>(this.baseUrl + 'review/chapter/'+chapterId, {seriesId, body});
|
||||
return this.httpClient.post<UserReview>(this.baseUrl + 'review/chapter/'+chapterId, {seriesId, rating, body});
|
||||
}
|
||||
|
||||
deleteChapterReview(chapterId: number) {
|
||||
return this.httpClient.delete(this.baseUrl + 'review/chapter/'+chapterId);
|
||||
}
|
||||
|
||||
overallRating(chapterId: number) {
|
||||
return this.httpClient.get<Rating>(this.baseUrl + 'rating/overall?chapterId='+chapterId);
|
||||
}
|
||||
|
||||
updateRating(chapterId: number, rating: number) {
|
||||
return this.httpClient.post(this.baseUrl + 'chapter/update-rating', {chapterId, rating});
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue