Skip to content

Commit

Permalink
tweak api values
Browse files Browse the repository at this point in the history
  • Loading branch information
madebyzak committed Mar 10, 2025
1 parent 92eabf9 commit fb16d27
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion server/@types/managingAppsApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export interface Application {
id: string
reference: string
assignedGroup: AssignedGroup
type: string
appType: string
requestedBy: RequestedBy
requestedDate: string
createdDate: string
Expand Down
2 changes: 1 addition & 1 deletion server/constants/applicationTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ export const APPLICATION_TYPES = [
{
name: 'Swap visiting orders (VOs) for PIN credit',
value: 'swap-visiting-orders-for-pin-credit',
apiValue: 'SWAP_VISITING_ORDERS_FOR_PIN_CREDIT',
apiValue: 'PIN_PHONE_CREDIT_TOP_UP',
},
]
2 changes: 1 addition & 1 deletion server/data/managingPrisonerAppsClient.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe('Managing Prisoner Apps API Client', () => {

it('should fetch a prisoner application by prisoner and application ID', async () => {
fakeManagingPrisonerAppApi
.get('/v1/prisoners/prisoner-id/apps/app-id')
.get('/v1/prisoners/prisoner-id/apps/app-id?requestedBy=true')
.matchHeader('authorization', `Bearer ${user.token}`)
.reply(200, prisonerApp)

Expand Down
2 changes: 1 addition & 1 deletion server/data/managingPrisonerAppsClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default class ManagingPrisonerAppsApiClient {
async getPrisonerApp(prisonerId: string, applicationId: string): Promise<Application | null> {
try {
return await this.restClient.get({
path: `/v1/prisoners/${prisonerId}/apps/${applicationId}`,
path: `/v1/prisoners/${prisonerId}/apps/${applicationId}?requestedBy=true`,
})
} catch (error) {
logger.error(`Error fetching application for prisonerId: ${prisonerId}, applicationId: ${applicationId}`, error)
Expand Down
4 changes: 2 additions & 2 deletions server/routes/applications/forwardApplicationRoutes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default function forwardApplicationRoutes({
correlationId: req.id,
})

const applicationType = getApplicationType(application.type)
const applicationType = getApplicationType(application.appType)

if (!applicationType) {
return res.redirect(`/applications/${departmentName}/pending?error=unknown-type`)
Expand Down Expand Up @@ -60,7 +60,7 @@ export default function forwardApplicationRoutes({
return res.redirect(`/applications/${departmentName}/pending`)
}

const applicationType = getApplicationType(application.type)
const applicationType = getApplicationType(application.appType)
const errors = validateForwardingApplication(forwardToDepartment, forwardingReason)

if (Object.keys(errors).length > 0) {
Expand Down
2 changes: 1 addition & 1 deletion server/routes/applications/viewApplicationsRoutes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default function viewApplicationRoutes({
correlationId: req.id,
})

const applicationType = getApplicationType(application.type)
const applicationType = getApplicationType(application.appType)

if (!applicationType) {
return res.redirect(`/applications/${departmentName}/pending?error=unknown-type`)
Expand Down
2 changes: 1 addition & 1 deletion server/routes/testutils/testData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default class TestData {
type: 'DEPARTMENT',
email: 'business+hub+ABC@justice.gov.uk',
},
type: 'SWAP_VISITING_ORDERS_FOR_PIN_CREDIT',
appType: 'SWAP_VISITING_ORDERS_FOR_PIN_CREDIT',
requestedBy: {
id: 'G123456',
firstName: 'Emily',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
text: "Status"
},
value: {
text: ""
text: application.status
}
},
{
Expand All @@ -52,7 +52,7 @@
actions: {
items: [
{
href: "/applications/" + departmentName + "/" + application.requestedBy.id + "/" + application.id + "/forward",
href: "/applications/" + departmentName + "/" + application.requestedBy.username + "/" + application.id + "/forward",
text: "Forward",
visuallyHiddenText: "department"
}
Expand All @@ -72,7 +72,7 @@
text: "Date sent"
},
value: {
text: application.requestedDate
text: application.requestedDateTime
}
},
{
Expand All @@ -95,7 +95,7 @@
text: "Prisoner"
},
value: {
text: application.requestedBy.id
text: application.requestedBy.username
},
actions: {
items: [
Expand Down

0 comments on commit fb16d27

Please sign in to comment.