Skip to content

Commit

Permalink
fix: enable disable functionality (#1292)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomzemp authored Aug 14, 2023
1 parent ed8b368 commit 213307d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
11 changes: 8 additions & 3 deletions src/pages/UserList/ContextMenu/Modals/DisableModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,14 @@ const DisableModal = ({ user, refetchUsers, onClose }) => {
try {
await engine.mutate({
resource: `users/${user.id}`,
type: 'update',
partial: true,
data: { userCredentials: { disabled: true } },
type: 'json-patch',
data: [
{
op: 'replace',
path: '/userCredentials/disabled',
value: true,
},
],
})
const message = i18n.t('User "{{- name}}" disabled successfuly', {
name: user.displayName,
Expand Down
11 changes: 8 additions & 3 deletions src/pages/UserList/ContextMenu/Modals/EnableModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,14 @@ const EnableModal = ({ user, refetchUsers, onClose }) => {
try {
await engine.mutate({
resource: `users/${user.id}`,
type: 'update',
partial: true,
data: { userCredentials: { disabled: false } },
type: 'json-patch',
data: [
{
op: 'replace',
path: '/userCredentials/disabled',
value: false,
},
],
})
const message = i18n.t('User "{{- name}}" enabled successfuly', {
name: user.displayName,
Expand Down

0 comments on commit 213307d

Please sign in to comment.