diff --git a/api.planx.uk/modules/send/bops/bops.ts b/api.planx.uk/modules/send/bops/bops.ts index 22e4568a11..9bfed5c288 100644 --- a/api.planx.uk/modules/send/bops/bops.ts +++ b/api.planx.uk/modules/send/bops/bops.ts @@ -44,7 +44,8 @@ const sendToBOPS = async (req: Request, res: Response, next: NextFunction) => { // a local or staging API instance should send to the BOPS staging endpoint // production should send to the BOPS production endpoint const localAuthority = req.params.localAuthority; - const env = process.env.NODE_ENV === "production" ? "production" : "staging"; + const env = + process.env.APP_ENVIRONMENT === "production" ? "production" : "staging"; const bopsSubmissionURL = await $api.team.getBopsSubmissionURL( localAuthority, env, @@ -178,21 +179,13 @@ const sendToBOPSV2 = async ( // a local or staging API instance should send to the BOPS staging endpoint // production should send to the BOPS production endpoint const localAuthority = req.params.localAuthority; - const env = process.env.NODE_ENV === "production" ? "production" : "staging"; + const env = + process.env.APP_ENVIRONMENT === "production" ? "production" : "staging"; const bopsSubmissionURL = await $api.team.getBopsSubmissionURL( localAuthority, env, ); const isSupported = Boolean(bopsSubmissionURL); - if (!isSupported) { - return next( - new ServerError({ - status: 400, - message: `Back-office Planning System (BOPS) is not enabled for this local authority (${localAuthority})`, - }), - ); - } - if (!isSupported) { return next( new ServerError({ diff --git a/e2e/tests/api-driven/src/invite-to-pay/helpers.ts b/e2e/tests/api-driven/src/invite-to-pay/helpers.ts index e736da0b39..ca777943b9 100644 --- a/e2e/tests/api-driven/src/invite-to-pay/helpers.ts +++ b/e2e/tests/api-driven/src/invite-to-pay/helpers.ts @@ -164,13 +164,13 @@ const setupMockBopsSubmissionUrl = async (teamId: number) => { await $admin.client.request( gql` mutation SetupTeamIntegrationE2E( - $staging_bops_submission_url: String - $team_id: Int + $stagingBopsSubmissionUrl: String + $teamId: Int ) { insert_team_integrations_one( object: { - teamId: $team_id - stagingBopsSubmissionUrl: $staging_bops_submission_url + team_id: $teamId + staging_bops_submission_url: $stagingBopsSubmissionUrl } ) { id