Skip to content

Commit

Permalink
Изменен адрес сервера
Browse files Browse the repository at this point in the history
  • Loading branch information
elviraSolov committed Nov 9, 2024
1 parent 61a30f8 commit b85ff8e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 47 deletions.
20 changes: 0 additions & 20 deletions .editorconfig

This file was deleted.

18 changes: 0 additions & 18 deletions .eslintrc

This file was deleted.

16 changes: 7 additions & 9 deletions js/api.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
const getData = (onSuccess) => {
fetch('https://25.javascript.pages.academy/kekstagram/data')
fetch("https://25.javascript.htmlacademy.pro/kekstagram/data")
.then((response) => response.json())
.then((posts) => {
onSuccess(posts);
});
};

const sendData = (onSuccess, onFail, body) => {
fetch('https://25.javascript.pages.academy/kekstagram',
{
method: 'POST',
body,
},
)
fetch("https://25.javascript.htmlacademy.pro/kekstagram", {
method: "POST",
body,
})
.then((response) => {
if(!response.ok) {
throw new Error('Не удалось отправить фото. Попробуйте еще раз');
if (!response.ok) {
throw new Error("Не удалось отправить фото. Попробуйте еще раз");
}
onSuccess();
})
Expand Down

0 comments on commit b85ff8e

Please sign in to comment.