1
0
Fork 0
mirror of synced 2024-09-08 21:51:58 +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 let editModal, deleteModal
$: group = $groups.find(x => x._id === groupId) $: group = $groups.find(x => x._id === groupId)
$: console.warn({ group })
$: readonly = !sdk.users.isAdmin($auth.user) || group?.scimInfo?.isSync $: readonly = !sdk.users.isAdmin($auth.user) || group?.scimInfo?.isSync
$: groupApps = $apps $: groupApps = $apps
.filter(app => .filter(app =>
@ -79,9 +80,8 @@
} }
async function saveGroup(group) { async function saveGroup(group) {
const { scimInfo, ...dataToSave } = group
try { try {
await groups.actions.save(dataToSave) await groups.actions.save(group)
} catch (error) { } catch (error) {
if (error.message) { if (error.message) {
notifications.error(error.message) notifications.error(error.message)

View file

@ -35,7 +35,8 @@ export function createGroupsStore() {
get: getGroup, get: getGroup,
save: async group => { save: async group => {
const response = await API.saveGroup(group) const { scimInfo, ...dataToSave } = group
const response = await API.saveGroup(dataToSave)
group._id = response._id group._id = response._id
group._rev = response._rev group._rev = response._rev
updateStore(group) updateStore(group)

@ -1 +1 @@
Subproject commit b4b25a0ac1a395ae6c62f13fd2411cc9b134fa12 Subproject commit 1b6964d047ffa1dd628758e4215c0242a06a5780