From dad88ec7667a84882539d34abf1f29c0990bde0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Gr=C3=B6ger?= Date: Fri, 19 Nov 2021 23:10:28 +0100 Subject: [PATCH] [api][fix] fixed setting roles --- api/src/stores/user.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/api/src/stores/user.ts b/api/src/stores/user.ts index 055f11f..9110c80 100644 --- a/api/src/stores/user.ts +++ b/api/src/stores/user.ts @@ -91,7 +91,15 @@ export const useUserStore = defineStore({ }, async updateRole(role: FG.Role) { - await api.put(`/roles/${role.id}`, role); + try { + await api.put(`/roles/${role.id}`, role); + } catch (error) { + console.warn(error); + } + this._updatePermission(role); + }, + + _updatePermission(role: FG.Role) { const idx = this.roles.findIndex((r) => r.id === role.id); if (idx != -1) this.roles[idx] = role; this._dirty_roles = true;