release v2.0.0 #4
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue