Skip to content

Commit 209cf1c

Browse files
committed
fix: получаем и обрабатываем jsonp, а не сырые данные
1 parent 5c6337c commit 209cf1c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/js/fetchRssData.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@ import axios from "axios";
22
import { model } from "./model/index.js";
33

44
export const fetchRssData = (link) => {
5-
const proxyUrl = `https://allorigins.hexlet.app/raw?disableCache=true&url=${encodeURIComponent(link)}`;
5+
const proxyUrl = `https://allorigins.hexlet.app/get?disableCache=true&url=${encodeURIComponent(link)}`;
66
return axios
77
.get(proxyUrl)
88
.then((response) => {
9-
return response.data;
9+
const data = response.data;
10+
return data.contents;
1011
})
1112
.catch((error) => {
1213
model.error.handle(error, "fetch");

0 commit comments

Comments
 (0)