1
0
Fork 0
mirror of synced 2024-07-11 09:15:48 +12:00

Move responsability to the store

This commit is contained in:
Adria Navarro 2024-02-28 14:41:31 +01:00
parent b4092fed05
commit cfdb0d98a2
3 changed files with 5 additions and 4 deletions

View file

@ -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)

View file

@ -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