Add search for users

Change-Id: I4bb4b33819b66846645e2e7a3d38d3e837a5bcd8
This commit is contained in:
Michael Albert 2020-10-08 08:07:55 +02:00
parent 4324ebfdb8
commit 3d7c0bf67f
2 changed files with 4 additions and 1 deletions

View File

@ -25,6 +25,7 @@ import {
TextInput, TextInput,
ReferenceField, ReferenceField,
ReferenceManyField, ReferenceManyField,
SearchInput,
SelectInput, SelectInput,
BulkDeleteButton, BulkDeleteButton,
DeleteButton, DeleteButton,
@ -98,6 +99,7 @@ const UserPagination = props => (
const UserFilter = props => ( const UserFilter = props => (
<Filter {...props}> <Filter {...props}>
<SearchInput source="name" alwaysOn />
<BooleanInput source="guests" alwaysOn /> <BooleanInput source="guests" alwaysOn />
<BooleanInput <BooleanInput
label="resources.users.fields.show_deactivated" label="resources.users.fields.show_deactivated"

View File

@ -137,7 +137,7 @@ function getSearchOrder(order) {
const dataProvider = { const dataProvider = {
getList: (resource, params) => { getList: (resource, params) => {
console.log("getList " + resource); 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 { page, perPage } = params.pagination;
const { field, order } = params.sort; const { field, order } = params.sort;
const from = (page - 1) * perPage; const from = (page - 1) * perPage;
@ -145,6 +145,7 @@ const dataProvider = {
from: from, from: from,
limit: perPage, limit: perPage,
user_id: user_id, user_id: user_id,
name: name,
guests: guests, guests: guests,
deactivated: deactivated, deactivated: deactivated,
order_by: field, order_by: field,