Search on frontend
This commit is contained in:
parent
0d5c14f22a
commit
46963bca69
|
@ -12,7 +12,7 @@
|
|||
|
||||
export let groupId
|
||||
|
||||
let searchTerm
|
||||
let emailSearch
|
||||
let fetchGroupUsers
|
||||
$: fetchGroupUsers = fetchData({
|
||||
API,
|
||||
|
@ -22,7 +22,7 @@
|
|||
options: {
|
||||
query: {
|
||||
groupId,
|
||||
searchTerm,
|
||||
emailSearch,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
@ -71,7 +71,7 @@
|
|||
</div>
|
||||
|
||||
<div class="controls-right">
|
||||
<Search bind:value={searchTerm} placeholder="Search" />
|
||||
<Search bind:value={emailSearch} placeholder="Search" />
|
||||
</div>
|
||||
<Table
|
||||
schema={userSchema}
|
||||
|
|
|
@ -55,13 +55,13 @@ export const buildGroupsEndpoints = API => {
|
|||
/**
|
||||
* Gets a group users by the group id
|
||||
*/
|
||||
getGroupUsers: async ({ id, bookmark, searchTerm }) => {
|
||||
getGroupUsers: async ({ id, bookmark, emailSearch }) => {
|
||||
let url = `/api/global/groups/${id}/users?`
|
||||
if (bookmark) {
|
||||
url += `bookmark=${bookmark}&`
|
||||
}
|
||||
if (searchTerm) {
|
||||
url += `searchTerm=${searchTerm}&`
|
||||
if (emailSearch) {
|
||||
url += `emailSearch=${emailSearch}&`
|
||||
}
|
||||
|
||||
return await API.get({
|
||||
|
|
|
@ -31,7 +31,7 @@ export default class GroupUserFetch extends DataFetch {
|
|||
try {
|
||||
const res = await this.API.getGroupUsers({
|
||||
id: query.groupId,
|
||||
searchTerm: query.searchTerm,
|
||||
emailSearch: query.emailSearch,
|
||||
bookmark: cursor,
|
||||
})
|
||||
|
||||
|
|
Loading…
Reference in New Issue