feat: started details page
This commit is contained in:
@@ -2,7 +2,8 @@ import { HttpClient } from "@angular/common/http";
|
||||
import { Injectable } from "@angular/core";
|
||||
import { Observable, catchError, map, throwError } from "rxjs";
|
||||
import { ESiteUrls } from "../urls";
|
||||
import { IRulibSearchResult } from "./rulib.dto";
|
||||
import { IRulibDetailResult } from "./rulib.detail.dto";
|
||||
import { IRulibSearchResult } from "./rulib.search.dto";
|
||||
|
||||
//TODO: Make abstract classes
|
||||
@Injectable({
|
||||
@@ -25,14 +26,14 @@ export class LibSocialParserService {
|
||||
);
|
||||
}
|
||||
|
||||
getDetails(slug_url: string) {
|
||||
getDetails(slug_url: string): Observable<IRulibDetailResult> {
|
||||
return this.http
|
||||
.get(
|
||||
`${this.url}/api/manga/${slug_url}?fields[]=summary&fields[]=genres&fields[]=tags&fields[]=authors`,
|
||||
)
|
||||
.pipe(
|
||||
map((data: object) => {
|
||||
return data;
|
||||
return data as IRulibDetailResult;
|
||||
}),
|
||||
catchError((error) => {
|
||||
return throwError(() => `Now found ${error}`);
|
||||
|
||||
Reference in New Issue
Block a user