Skip to content

Commit

Permalink
fix(j-s): Filtering of public prosecutor cases
Browse files Browse the repository at this point in the history
  • Loading branch information
unakb committed May 15, 2024
1 parent b3b8102 commit c306f1a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,7 @@ const getProsecutionUserCasesQueryFilter = (user: User): WhereOptions => {
{ prosecutors_office_id: user.institution?.id },
{ shared_with_prosecutors_office_id: user.institution?.id },
{
[Op.and]: [
{ indictment_reviewer_id: user.id },
{ indictment_review_decision: null },
],
[Op.and]: [{ indictment_reviewer_id: user.id }],
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,7 @@ describe('getCasesQueryFilter', () => {
[Op.or]: [
{ prosecutors_office_id: 'Prosecutors Office Id' },
{ shared_with_prosecutors_office_id: 'Prosecutors Office Id' },
{
[Op.and]: [
{ indictment_reviewer_id: 'Prosecutor Id' },
{ indictment_review_decision: null },
],
},
{ indictment_reviewer_id: 'Prosecutor Id' },
],
},
{
Expand Down Expand Up @@ -123,12 +118,7 @@ describe('getCasesQueryFilter', () => {
[Op.or]: [
{ prosecutors_office_id: 'Prosecutors Office Id' },
{ shared_with_prosecutors_office_id: 'Prosecutors Office Id' },
{
[Op.and]: [
{ indictment_reviewer_id: 'Prosecutor Id' },
{ indictment_review_decision: null },
],
},
{ indictment_reviewer_id: 'Prosecutor Id' },
],
},
{
Expand Down
4 changes: 1 addition & 3 deletions apps/judicial-system/web/src/routes/Shared/Cases/Cases.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,7 @@ export const Cases: React.FC = () => {

const casesAwaitingReview = filterCases(
(c) =>
isIndictmentCase(c.type) &&
c.indictmentReviewer !== null &&
c.indictmentReviewer?.id === user?.id,
c.indictmentReviewer?.id === user?.id && !c.indictmentReviewDecision,
)

const activeCases = filterCases((c) => {
Expand Down

0 comments on commit c306f1a

Please sign in to comment.