Move responsability to the store
This commit is contained in:
parent
b4092fed05
commit
cfdb0d98a2
|
@ -48,6 +48,7 @@
|
|||
let editModal, deleteModal
|
||||
|
||||
$: group = $groups.find(x => x._id === groupId)
|
||||
$: console.warn({ group })
|
||||
$: readonly = !sdk.users.isAdmin($auth.user) || group?.scimInfo?.isSync
|
||||
$: groupApps = $apps
|
||||
.filter(app =>
|
||||
|
@ -79,9 +80,8 @@
|
|||
}
|
||||
|
||||
async function saveGroup(group) {
|
||||
const { scimInfo, ...dataToSave } = group
|
||||
try {
|
||||
await groups.actions.save(dataToSave)
|
||||
await groups.actions.save(group)
|
||||
} catch (error) {
|
||||
if (error.message) {
|
||||
notifications.error(error.message)
|
||||
|
|
|
@ -35,7 +35,8 @@ export function createGroupsStore() {
|
|||
get: getGroup,
|
||||
|
||||
save: async group => {
|
||||
const response = await API.saveGroup(group)
|
||||
const { scimInfo, ...dataToSave } = group
|
||||
const response = await API.saveGroup(dataToSave)
|
||||
group._id = response._id
|
||||
group._rev = response._rev
|
||||
updateStore(group)
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit b4b25a0ac1a395ae6c62f13fd2411cc9b134fa12
|
||||
Subproject commit 1b6964d047ffa1dd628758e4215c0242a06a5780
|
Loading…
Reference in New Issue