mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-18 14:23:44 +02:00
Add support for editing a subuser
This commit is contained in:
@@ -38,7 +38,20 @@ const subusers: ServerSubuserStore = {
|
||||
}),
|
||||
|
||||
appendSubuser: action((state, payload) => {
|
||||
state.data = [ ...state.data.filter(user => user.uuid !== payload.uuid), payload ];
|
||||
let matched = false;
|
||||
state.data = [
|
||||
...state.data
|
||||
.map(user => {
|
||||
if (user.uuid === payload.uuid) {
|
||||
matched = true;
|
||||
|
||||
return payload;
|
||||
}
|
||||
|
||||
return user;
|
||||
})
|
||||
.concat(matched ? [] : [ payload ]),
|
||||
];
|
||||
}),
|
||||
|
||||
removeSubuser: action((state, payload) => {
|
||||
|
||||
Reference in New Issue
Block a user