diff --git a/frontend/static/css/me.css b/frontend/static/css/settings.css similarity index 100% rename from frontend/static/css/me.css rename to frontend/static/css/settings.css diff --git a/frontend/static/js/api/MyProfile.js b/frontend/static/js/api/MyProfile.js index de3f46e..fb4a9fd 100644 --- a/frontend/static/js/api/MyProfile.js +++ b/frontend/static/js/api/MyProfile.js @@ -9,7 +9,7 @@ class MyProfile extends Profile */ constructor (client) { - super(client, "me") + super(client, "../me") } /** @@ -19,7 +19,7 @@ class MyProfile extends Profile */ async change_avatar(form_data) { - let response = await this.client._patch_file(`/api/profiles/me`, form_data); + let response = await this.client._patch_file(`/api/profiles/settings`, form_data); let response_data = await response.json() return response_data; @@ -27,4 +27,4 @@ class MyProfile extends Profile } -export {MyProfile} \ No newline at end of file +export {MyProfile} diff --git a/frontend/static/js/api/client.js b/frontend/static/js/api/client.js index 7e7a183..5df70bf 100644 --- a/frontend/static/js/api/client.js +++ b/frontend/static/js/api/client.js @@ -150,7 +150,7 @@ class Client async _patch_json(uri, data) { let response = await fetch(this._url + uri, { - ethod: "PATCH", + method: "PATCH", headers: { "X-CSRFToken": getCookie("csrftoken"), "Content-Type": "application/json", diff --git a/frontend/static/js/api/profile.js b/frontend/static/js/api/profile.js index 2b57a04..8fcc6bf 100644 --- a/frontend/static/js/api/profile.js +++ b/frontend/static/js/api/profile.js @@ -42,7 +42,7 @@ class Profile { let response; if (this.username !== undefined) - response = await this.client._get(`/api/profiles/${this.username}`); + response = await this.client._get(`/api/profiles/user/${this.username}`); else response = await this.client._get(`/api/profiles/id/${this.id}`); diff --git a/frontend/static/js/index.js b/frontend/static/js/index.js index a3111d2..911920a 100644 --- a/frontend/static/js/index.js +++ b/frontend/static/js/index.js @@ -12,7 +12,7 @@ import GameView from "./views/GameView.js"; import PageNotFoundView from './views/PageNotFoundView.js' import AbstractRedirectView from "./views/abstracts/AbstractRedirectView.js"; -import MeView from "./views/MeView.js"; +import SettingsView from "./views/SettingsView.js"; import ProfilePageView from "./views/ProfilePageView.js"; import MatchMakingView from "./views/MatchMakingView.js"; import TournamentPageView from "./views/tournament/TournamentPageView.js"; @@ -82,7 +82,7 @@ const router = async(uri) => { { path: "/register", view: RegisterView }, { path: "/search", view: Search }, { path: "/home", view: HomeView }, - { path: "/me", view: MeView }, + { path: "/settings", view: SettingsView }, { path: "/matchmaking", view: MatchMakingView }, { path: "/games/offline", view: GameOfflineView }, { path: "/games/:id", view: GameView }, diff --git a/frontend/static/js/lang/en.json b/frontend/static/js/lang/en.json index b6ad271..8bd8b4b 100644 --- a/frontend/static/js/lang/en.json +++ b/frontend/static/js/lang/en.json @@ -10,7 +10,7 @@ "homeTitle": "Home", "homeOnline": "Play online", "homeOffline": "Play offline", - "homeMe": "Me", + "homeSettings": "Settings", "homeLogout": "Logout", "loginWindowTitle": "Login", "loginFormTitle": "Login", diff --git a/frontend/static/js/lang/fr.json b/frontend/static/js/lang/fr.json index be38190..06d2434 100644 --- a/frontend/static/js/lang/fr.json +++ b/frontend/static/js/lang/fr.json @@ -10,7 +10,7 @@ "homeTitle": "Maison", "homeOnline": "Jouer en ligne", "homeOffline": "Jouer hors ligne", - "homeMe": "Moi", + "homeSettings": "Paramètres", "homeLogout": "Déconnexion", "loginWindowTitle": "Connexion", "loginFormTitle": "Connexion", diff --git a/frontend/static/js/views/HomeView.js b/frontend/static/js/views/HomeView.js index 458af60..8ac3ea2 100644 --- a/frontend/static/js/views/HomeView.js +++ b/frontend/static/js/views/HomeView.js @@ -12,7 +12,7 @@ export default class extends AbstractAuthentificateView {