Skip to content

Commit

Permalink
fix: filter draft submissions from the submission list during the sub…
Browse files Browse the repository at this point in the history
…mission search (#1073)

* fix: added a boolean check for filterformSubmissionStatusCode parameter

* fix: test failed issue fixes
  • Loading branch information
timisenco2015 authored Oct 11, 2023
1 parent c6a7dfa commit 6f55272
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/src/forms/form/service.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ const service = {
.modify('filterCreatedBy', params.createdBy)
.modify('filterFormVersionId', params.formVersionId)
.modify('filterVersion', params.version)
.modify('filterformSubmissionStatusCode', JSON.parse(params.filterformSubmissionStatusCode))
.modify('orderDefault', params.sortBy && params.page ? true : false, params);
if (params.createdAt && Array.isArray(params.createdAt) && params.createdAt.length == 2) {
query.modify('filterCreatedAt', params.createdAt[0], params.createdAt[1]);
Expand Down Expand Up @@ -338,7 +339,6 @@ const service = {
result.results = searchedData.slice(start, end);
return result;
} else {
await query.modify('filterformSubmissionStatusCode', filterformSubmissionStatusCode);
if (itemsPerPage && parseInt(itemsPerPage) === -1) {
return await query.page(parseInt(page), parseInt(totalSubmissions || 0));
} else if (itemsPerPage && parseInt(page) >= 0) {
Expand Down

0 comments on commit 6f55272

Please sign in to comment.