Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDI-126: ✨ Use description for absent reason #2116

Merged
merged 2 commits into from
Apr 20, 2022

Conversation

petergphillips
Copy link
Contributor

No description provided.

@@ -35,7 +35,6 @@ export const whereaboutsApiFactory = (client) => {

const putAttendance = (context, body, id) => put(context, `/attendance/${id}`, body)

const getAbsenceReasons = (context) => get(context, '/absence-reasons')
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no longer used as whereabouts now returns descriptions too

} from '../../utils'

const attendanceReasonStatsUrl = '/manage-prisoner-whereabouts/attendance-reason-statistics'

const formatReason = ({ name, triggersIEPWarning }) =>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now just using whereabouts description

@@ -309,7 +300,7 @@ export const attendanceStatisticsFactory = (oauthApi, prisonApi, whereaboutsApi)
})

const offenderData = absences.map((absence) => ({
offenderName: `${capitalize(absence.lastName)}, ${capitalize(absence.firstName)}`,
offenderName: putLastNameFirst(absence.firstName, absence.lastName),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use better method for formatting the offender name too

@@ -300,7 +291,7 @@ export const attendanceStatisticsFactory = (oauthApi, prisonApi, whereaboutsApi)
)
}

const { absences } = await whereaboutsApi.getAbsences(res.locals, {
const { absences, description: displayReason } = await whereaboutsApi.getAbsences(res.locals, {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

get description from whereabouts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants