Skip to content

Commit

Permalink
PP-11681 Replace ‘base-client’ with ‘axios-base-client’
Browse files Browse the repository at this point in the history
- Change  ‘adminusers.client’ methods to use ‘axios-base-client’.
- Refactor call parameters initialisation.
- Use ‘async/await’ syntax.
- Extend ‘instanceof RESTClientError’ test in registration controller to include a test for constructor name.
  This is order to identify an error thrown by the new 'axios-base-client'. Possibly needs refactoring.
  • Loading branch information
JFSGDS committed Feb 21, 2024
1 parent c8d91ee commit b252478
Show file tree
Hide file tree
Showing 2 changed files with 312 additions and 507 deletions.
2 changes: 1 addition & 1 deletion app/controllers/registration/registration.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ async function submitEmailPage (req, res, next) {

res.redirect(paths.register.checkEmail)
} catch (err) {
if (err instanceof RESTClientError) {
if (err instanceof RESTClientError | err.constructor.name === 'RESTClientError') {
if (err.errorCode === 403) {
errors[EMAIL_INPUT_FIELD_NAME] = validationErrors.notPublicSectorEmail
return res.render('registration/email', { errors, email })
Expand Down
Loading

0 comments on commit b252478

Please sign in to comment.