fixed article endpoint
This commit is contained in:
parent
bd6fbbebfd
commit
d77c1c6388
@ -3,16 +3,19 @@ import { Article } from "../domain/articleEntity";
|
||||
import { create } from "../domain/articleModel";
|
||||
import { FetchArticleByIdDTO } from "./dto/fetch_article_by_id_dto";
|
||||
import Failure from "core/failure";
|
||||
import { integratorApiClient } from "core/httpClient";
|
||||
|
||||
const articleEndpoint = "/papers/"
|
||||
|
||||
async function getArticle(id: string): Promise<Article> {
|
||||
try {
|
||||
// await new Promise((res, _) => {
|
||||
// setTimeout(() => res(null), 2000);
|
||||
// });
|
||||
const response = await axios.get<FetchArticleByIdDTO>(
|
||||
`https://run.mocky.io/v3/62cd4581-d864-4d46-b1d6-02b45b5d1994/${id}`
|
||||
const response = await integratorApiClient.get<FetchArticleByIdDTO>(
|
||||
// `https://run.mocky.io/v3/62cd4581-d864-4d46-b1d6-02b45b5d1994/${id}`
|
||||
// `https://jsonplaceholder.typicode.com/posts/${id}`
|
||||
// `http://scipaper.ru/v1/papers/${id}`
|
||||
articleEndpoint + id
|
||||
);
|
||||
const dto = response.data;
|
||||
return create({
|
||||
|
Loading…
x
Reference in New Issue
Block a user