From 2ccfc5464a7809c25310f1468aabbd3604285730 Mon Sep 17 00:00:00 2001 From: starnakin Date: Mon, 11 Dec 2023 15:23:42 +0100 Subject: [PATCH 1/3] fix: fix: + ratio --- profiles/viewsets.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/profiles/viewsets.py b/profiles/viewsets.py index 0c6b86f..937b3cc 100644 --- a/profiles/viewsets.py +++ b/profiles/viewsets.py @@ -17,7 +17,7 @@ class ProfileViewSet(viewsets.ModelViewSet): permission_classes = (permissions.IsAuthenticatedOrReadOnly,) def retrieve(self, request: HttpRequest, pk=None): - instance = self.get_object() + instance = ProfileModel.objects.get(pk=pk) instance.avatar_url.name = instance.avatar_url.name[instance.avatar_url.name.find("static") - 1:] return Response(self.serializer_class(instance).data, status=status.HTTP_200_OK) From 85787760b9ab9576b9103cb0711498ff69835abb Mon Sep 17 00:00:00 2001 From: starnakin Date: Mon, 11 Dec 2023 15:54:56 +0100 Subject: [PATCH 2/3] fix: back button is back --- frontend/static/js/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/static/js/index.js b/frontend/static/js/index.js index c263079..9501016 100644 --- a/frontend/static/js/index.js +++ b/frontend/static/js/index.js @@ -32,7 +32,7 @@ const navigateTo = async (uri) => { history.pushState(null, null, uri); }; -const router = async (uri = "") => { +const router = async (uri) => { const routes = [ { path: "/", view: Dashboard }, { path: "/profiles", view: ProfilesView}, @@ -84,7 +84,7 @@ const router = async (uri = "") => { return 0; }; -window.addEventListener("popstate", router); +window.addEventListener("popstate", function() {router(this.location.pathname)}); document.addEventListener("DOMContentLoaded", () => { document.body.addEventListener("click", e => { From 982130a02fdb6fc551663919d98eb0d11ccee457 Mon Sep 17 00:00:00 2001 From: starnakin Date: Mon, 11 Dec 2023 15:59:15 +0100 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=A4=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/static/js/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/static/js/index.js b/frontend/static/js/index.js index 9501016..b647ca4 100644 --- a/frontend/static/js/index.js +++ b/frontend/static/js/index.js @@ -84,7 +84,7 @@ const router = async (uri) => { return 0; }; -window.addEventListener("popstate", function() {router(this.location.pathname)}); +window.addEventListener("popstate", function() {router(location.pathname)}); document.addEventListener("DOMContentLoaded", () => { document.body.addEventListener("click", e => {