Skip to content

Commit

Permalink
api requires url changed
Browse files Browse the repository at this point in the history
  • Loading branch information
OddyHater committed Sep 9, 2023
1 parent 6b703ec commit 797c15b
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 17 deletions.
6 changes: 3 additions & 3 deletions frontend/build/asset-manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"files": {
"main.css": "/static/css/main.a691e8d2.css",
"main.js": "/static/js/main.fc83b796.js",
"main.js": "/static/js/main.2f3c9ca9.js",
"static/media/Inter-Medium.woff": "/static/media/Inter-Medium.9053572c46aeb4b16caa.woff",
"static/media/Inter-Black.woff": "/static/media/Inter-Black.c6938660eec019fefd68.woff",
"static/media/Inter-Regular.woff": "/static/media/Inter-Regular.8c206db99195777c6769.woff",
Expand All @@ -20,10 +20,10 @@
"static/media/edit.svg": "/static/media/edit.5f7df902c26d761a5259.svg",
"static/media/add.svg": "/static/media/add.9d4893b84ffe6c9d13b3.svg",
"main.a691e8d2.css.map": "/static/css/main.a691e8d2.css.map",
"main.fc83b796.js.map": "/static/js/main.fc83b796.js.map"
"main.2f3c9ca9.js.map": "/static/js/main.2f3c9ca9.js.map"
},
"entrypoints": [
"static/css/main.a691e8d2.css",
"static/js/main.fc83b796.js"
"static/js/main.2f3c9ca9.js"
]
}
2 changes: 1 addition & 1 deletion frontend/build/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>Mesto React</title><script defer="defer" src="/static/js/main.fc83b796.js"></script><link href="/static/css/main.a691e8d2.css" rel="stylesheet"></head><body class="page"><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
<!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>Mesto React</title><script defer="defer" src="/static/js/main.2f3c9ca9.js"></script><link href="/static/css/main.a691e8d2.css" rel="stylesheet"></head><body class="page"><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions frontend/build/static/js/main.2f3c9ca9.js.map

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion frontend/build/static/js/main.fc83b796.js.map

This file was deleted.

12 changes: 6 additions & 6 deletions frontend/src/utils/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class Api {
}

pushCardToServer({name, link, like, id}) {
return fetch(`https://mesto.${this._url}/cards`, {
return fetch(`https://${this._url}/cards`, {
method: 'POST',
headers: this._headers,
body: JSON.stringify({
Expand All @@ -54,7 +54,7 @@ class Api {
}

removeCardFromServer(cardID) {
return fetch(`https://mesto.${this._url}/cards/${cardID}`, {
return fetch(`https://${this._url}/cards/${cardID}`, {
method: 'DELETE',
headers: this._headers
})
Expand All @@ -64,7 +64,7 @@ class Api {
}

addLike(cardId) {
return fetch(`https://mesto.${this._url}/cards/${cardId}/likes`, {
return fetch(`https://${this._url}/cards/${cardId}/likes`, {
method: 'PUT',
headers: this._headers
})
Expand All @@ -74,7 +74,7 @@ class Api {
}

removeLike(cardId) {
return fetch(`https://mesto.${this._url}/cards/${cardId}/likes`, {
return fetch(`https://${this._url}/cards/${cardId}/likes`, {
method: 'DELETE',
headers: this._headers
})
Expand All @@ -84,7 +84,7 @@ class Api {
}

changeAvatar(link) {
return fetch(`https://mesto.${this._url}/users/me/avatar`, {
return fetch(`https://${this._url}/users/me/avatar`, {
method: 'PATCH',
headers: this._headers,
body: JSON.stringify({
Expand All @@ -97,7 +97,7 @@ class Api {
}

getInitialCards() {
return fetch(`https://mesto.${this._url}/cards`, {
return fetch(`https://${this._url}/cards`, {
headers: this._headers
})
.then(res => {
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/utils/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Auth {
}

regiser({email, password}) {
return fetch(`${this._url}/signup`, {
return fetch(`https://${this._url}/signup`, {
method: 'POST',
headers: {
"Content-Type": "application/json"
Expand All @@ -24,7 +24,7 @@ class Auth {
}

login({email, password}) {
return fetch(`${this._url}/signin`, {
return fetch(`https://${this._url}/signin`, {
method: 'POST',
headers: {
"Content-Type": "application/json"
Expand All @@ -38,7 +38,7 @@ class Auth {
}

checkToken(token) {
return fetch(`${this._url}/users/me`, {
return fetch(`https://${this._url}/users/me`, {
method: 'GET',
headers: {
"Content-Type": "application/json",
Expand Down

0 comments on commit 797c15b

Please sign in to comment.