Skip to content

Commit

Permalink
fix: Wrong permission issue on edit user modal
Browse files Browse the repository at this point in the history
  • Loading branch information
dogukanoksuz committed Mar 20, 2024
1 parent 2d1e47b commit 4ee1e5c
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/components/settings/edit-user.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,28 @@ export default function EditUser() {
const d = data as IUser
setUser(d)
setOpen(true)
form.reset({
id: d.id,
name: d.name,
username: d.username,
email: d.email,
status: d.status,
password: "",
roles: [],
})

apiService
.getInstance()
.get(`/settings/users/${d.id}/roles`)
.then((res) => {
setRoles(res.data)
form.reset({
...d,
id: d.id,
name: d.name,
username: d.username,
email: d.email,
status: d.status,
password: "",
roles: res.data
.filter((r: any) => r.selected)
.map((r: any) => r.id),
Expand Down

0 comments on commit 4ee1e5c

Please sign in to comment.