From 806e499e879b1f235149f4ab19768d15d4f77e7c Mon Sep 17 00:00:00 2001 From: Kailash Nadh Date: Mon, 2 Sep 2024 21:46:06 +0530 Subject: [PATCH] Update profile UI with new user data structures. --- cmd/lists.go | 2 +- frontend/src/views/UserProfile.vue | 19 ++++++++++--------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/cmd/lists.go b/cmd/lists.go index 5ee518a0..051b23b4 100644 --- a/cmd/lists.go +++ b/cmd/lists.go @@ -189,6 +189,6 @@ func listPerm(next echo.HandlerFunc) echo.HandlerFunc { } } - return echo.NewHTTPError(http.StatusBadRequest, app.i18n.Ts("globals.messages.globals.messages.permissionDenied", "name", "list")) + return echo.NewHTTPError(http.StatusBadRequest, app.i18n.Ts("globals.messages.permissionDenied", "name", "list")) } } diff --git a/frontend/src/views/UserProfile.vue b/frontend/src/views/UserProfile.vue index a09df14f..abca2f4e 100644 --- a/frontend/src/views/UserProfile.vue +++ b/frontend/src/views/UserProfile.vue @@ -3,23 +3,22 @@

- @{{ form.username }} + @{{ data.username }}

- - {{ form.role.name }} + {{ data.userRole.name }}


- + + :disabled="!data.passwordLogin" required autofocus /> -
+
{ this.form.password = ''; this.form.password2 = ''; - this.$utils.toast(this.$t('globals.messages.updated', { name: this.form.username })); + this.$utils.toast(this.$t('globals.messages.updated', { name: this.data.username })); }); }, }, mounted() { this.$api.getUserProfile().then((data) => { - this.form = data; + this.data = { ...data }; + this.form = { name: data.name, email: data.email }; }); },