-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HOFF-659: Update NRM to use version of HOF that uses axios
- update hof version to use axios - remove request module in package.json vulnerabilities - update yarn.lock - update node images and dependencies to resolve vulnerabilities - remove deprecated request-native-promise from package.json and acceptance tests and replace with axios - refactored code in save-form-session, resume-form-session, delete-form-session, are-you-sure and continue-report behaviours to use hof model instead of request - update icasework-resolver image
- Loading branch information
1 parent
9c156c5
commit a408ddf
Showing
12 changed files
with
171 additions
and
397 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,30 @@ | ||
/* eslint-disable max-len */ | ||
'use strict'; | ||
const request = require('request'); | ||
const { model: Model } = require('hof'); | ||
const config = require('../../../config'); | ||
const logger = require('hof/lib/logger')({ env: config.env }); | ||
|
||
const encodeEmail = email => Buffer.from(email).toString('hex'); | ||
|
||
module.exports = superclass => class extends superclass { | ||
saveValues(req, res, next) { | ||
super.saveValues(req, res, err => { | ||
super.saveValues(req, res, async err => { | ||
if (err) { | ||
next(err); | ||
} | ||
request.del(config.saveService.host + ':' + config.saveService.port | ||
+ '/reports/' + encodeEmail(req.sessionModel.get('user-email')) + '/' + req.sessionModel.get('id'), next); | ||
|
||
try { | ||
const model = new Model(); | ||
const params = { | ||
url: `${config.saveService.host}:${config.saveService.port}/reports/${encodeEmail(req.sessionModel.get('user-email'))}/${req.sessionModel.get('id')}`, | ||
method: 'DELETE' | ||
}; | ||
await model._request(params); | ||
return next(); | ||
} catch (error) { | ||
logger.error(`Error deleting data: ${error.message}`); | ||
return next(error); | ||
} | ||
}); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM node:16.16.0 as base | ||
FROM node:20.17.0 as base | ||
|
||
EXPOSE 9222 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.