From c7056d9d162fe61eabc7efbc62843c5c6792944d Mon Sep 17 00:00:00 2001 From: vaishnavi-gupta18 Date: Sun, 30 Oct 2022 17:32:57 +0530 Subject: [PATCH] Add filter in download --- src/components/admin-complaints/index.js | 8 +++++++- src/components/student-database/index.js | 3 ++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/components/admin-complaints/index.js b/src/components/admin-complaints/index.js index 1ac1a8b..f40da4d 100644 --- a/src/components/admin-complaints/index.js +++ b/src/components/admin-complaints/index.js @@ -99,7 +99,7 @@ class AdminComplains extends Component { ) this.props.getTimeSlots(this.props.activeHostel) this.setState({ - complainsDownloadUrl: complainsDownloadUrl(this.props.activeHostel) + complainsDownloadUrl: `${complainsDownloadUrl(this.props.activeHostel)}?` }) } @@ -326,6 +326,9 @@ class AdminComplains extends Component { this.setState({ pendingLoading: true }) + this.setState({ + complainsDownloadUrl: `${this.state.complainsDownloadUrl}&search=${value}` + }) this.props.getPendingComplains( `${statusComplainsUrl(this.props.activeHostel, [ 'PENDING','INPROCESS' @@ -434,6 +437,9 @@ class AdminComplains extends Component { dateRange = this.dateFormatMatch(value) if (dateRange) { + this.setState({ + complainsDownloadUrl: `${this.state.complainsDownloadUrl}&date=${dateRange}` + }) this.setState({ pendingLoading: true, }) diff --git a/src/components/student-database/index.js b/src/components/student-database/index.js index 2c91323..6cf603b 100644 --- a/src/components/student-database/index.js +++ b/src/components/student-database/index.js @@ -110,7 +110,8 @@ class StudentDatabase extends Component { this.setState({ loading: true, - filter: filter + filter: filter, + currentResidentDownloadUrl: `${this.state.currentResidentDownloadUrl}?${filter}` }) this.props.getResidents(