Refetch initial data instead of refreshing

This commit is contained in:
Adria Navarro 2023-05-05 11:34:20 +01:00
parent 89afec9bfc
commit e91f9ea5cd
1 changed files with 3 additions and 4 deletions

View File

@ -95,7 +95,6 @@
$: page = $searchUsersPageInfo.page
$: searchUsers(page, searchTerm)
$: group = $groups.find(x => x._id === groupId)
$: filtered = $users.data
$: groupApps = $apps
.filter(app =>
groups.actions
@ -151,7 +150,7 @@
const removeUser = async id => {
await groups.actions.removeUser(groupId, id)
fetchGroupUsers.refresh()
fetchGroupUsers.getInitialData()
}
const removeApp = async app => {
@ -221,11 +220,11 @@
list={$users.data}
on:select={async e => {
await groups.actions.addUser(groupId, e.detail)
fetchGroupUsers.refresh()
fetchGroupUsers.getInitialData()
}}
on:deselect={async e => {
await groups.actions.removeUser(groupId, e.detail)
fetchGroupUsers.refresh()
fetchGroupUsers.getInitialData()
}}
/>
</Popover>