1
0
Fork 0
mirror of synced 2024-09-11 23:16:00 +12:00

Refetch users on changes

This commit is contained in:
Adria Navarro 2023-05-05 11:13:09 +01:00
parent 2c49232fa8
commit 89afec9bfc

View file

@ -151,6 +151,7 @@
const removeUser = async id => { const removeUser = async id => {
await groups.actions.removeUser(groupId, id) await groups.actions.removeUser(groupId, id)
fetchGroupUsers.refresh()
} }
const removeApp = async app => { const removeApp = async app => {
@ -218,15 +219,21 @@
labelKey="email" labelKey="email"
selected={group.users?.map(user => user._id)} selected={group.users?.map(user => user._id)}
list={$users.data} list={$users.data}
on:select={e => groups.actions.addUser(groupId, e.detail)} on:select={async e => {
on:deselect={e => groups.actions.removeUser(groupId, e.detail)} await groups.actions.addUser(groupId, e.detail)
fetchGroupUsers.refresh()
}}
on:deselect={async e => {
await groups.actions.removeUser(groupId, e.detail)
fetchGroupUsers.refresh()
}}
/> />
</Popover> </Popover>
</div> </div>
<Table <Table
schema={userSchema} schema={userSchema}
data={$fetchGroupUsers?.users} data={$fetchGroupUsers?.rows}
allowEditRows={false} allowEditRows={false}
customPlaceholder customPlaceholder
customRenderers={customUserTableRenderers} customRenderers={customUserTableRenderers}