Skip to content

Commit

Permalink
Add search for users
Browse files Browse the repository at this point in the history
Change-Id: I4bb4b33819b66846645e2e7a3d38d3e837a5bcd8
  • Loading branch information
awesome-michael committed Oct 8, 2020
1 parent 4324ebf commit 3d7c0bf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/components/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import {
TextInput,
ReferenceField,
ReferenceManyField,
SearchInput,
SelectInput,
BulkDeleteButton,
DeleteButton,
Expand Down Expand Up @@ -98,6 +99,7 @@ const UserPagination = props => (

const UserFilter = props => (
<Filter {...props}>
<SearchInput source="name" alwaysOn />
<BooleanInput source="guests" alwaysOn />
<BooleanInput
label="resources.users.fields.show_deactivated"
Expand Down
3 changes: 2 additions & 1 deletion src/synapse/dataProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,15 @@ function getSearchOrder(order) {
const dataProvider = {
getList: (resource, params) => {
console.log("getList " + resource);
const { user_id, guests, deactivated } = params.filter;
const { user_id, name, guests, deactivated } = params.filter;
const { page, perPage } = params.pagination;
const { field, order } = params.sort;
const from = (page - 1) * perPage;
const query = {
from: from,
limit: perPage,
user_id: user_id,
name: name,
guests: guests,
deactivated: deactivated,
order_by: field,
Expand Down

0 comments on commit 3d7c0bf

Please sign in to comment.