Skip to content

Commit

Permalink
Merge pull request #444 from ertush/hotfix
Browse files Browse the repository at this point in the history
Changed all instances of has_edits in as a url param to fetch facilit…
  • Loading branch information
ertush authored Aug 8, 2024
2 parents f894145 + ad27f48 commit d53b888
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion controllers/facility/approveRejectFacility.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ function approveRejectFacilityUpdates (reject, alert, update_id, token, setSubmi
pathname: '/facilities',
query: {
filter: 'updated_pending_validation_facilities',
has_edits: true
have_updates: true
}
}) // redirect to New Facilties Pending Validation

Expand Down
7 changes: 2 additions & 5 deletions pages/facilities/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ function FacilityHome (props){
router.push(`/facilities/?q=${query}&filter=pending_validation_facilities&pending_approval=true&has_edits=false`)
break;
case "updated_pending_validation_facilities":
router.push(`/facilities/?q=${query}&filter=updated_pending_validation_facilities&has_edits=true`)
router.push(`/facilities/?q=${query}&filter=updated_pending_validation_facilities&have_updates=true`)
break;
case "pending_approval_facilities":
router.push(`/facilities/?q=${query}&filter=pending_approval_facilities&to_publish=true`)
Expand Down Expand Up @@ -913,6 +913,7 @@ export async function getServerSideProps(ctx) {
"operation_status",
"constituency",
"ward",
"have_updates",
"has_edits",
"rejected_national",
"rejected",
Expand Down Expand Up @@ -973,10 +974,6 @@ export async function getServerSideProps(ctx) {
facilities?.results.length > 0
) {

// if(ctx?.query?.has_edits) {
// facilities = { results: facilities?.results?.filter(({latest_update}) => latest_update !== null), ...facilities }
// }

return {
props: {
facilities: facilities?.results ?? null,
Expand Down

0 comments on commit d53b888

Please sign in to comment.