Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/NUWCDIVNPT/stig-manager int…
Browse files Browse the repository at this point in the history
…o testing-new-iterations
  • Loading branch information
Matte22 committed Sep 17, 2024
2 parents 5c90ec2 + 16f1a85 commit 2622a4f
Show file tree
Hide file tree
Showing 6 changed files with 531 additions and 332 deletions.
8 changes: 4 additions & 4 deletions api/source/controllers/Asset.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ module.exports.deleteAsset = async function deleteAsset (req, res, next) {
let projection = req.query.projection
const { assetId } = await getAssetInfoAndVerifyAccess(req)
const response = await AssetService.getAsset(assetId, projection, elevate, req.userObject)
await AssetService.deleteAsset( assetId, projection, elevate, req.userObject )
await AssetService.deleteAsset( assetId, projection, elevate, req.userObject, res.svcStatus)
res.json(response)
}
catch (err) {
Expand All @@ -64,7 +64,7 @@ module.exports.removeStigFromAsset = async function removeStigFromAsset (req, re
let benchmarkId = req.params.benchmarkId
let elevate = req.query.elevate
const { assetId } = await getAssetInfoAndVerifyAccess(req)
let response = await AssetService.removeStigFromAsset(assetId, benchmarkId, elevate, req.userObject )
let response = await AssetService.removeStigFromAsset(assetId, benchmarkId, elevate, req.userObject, res.svcStatus)
res.json(response)
}
catch (err) {
Expand All @@ -76,7 +76,7 @@ module.exports.removeStigsFromAsset = async function removeStigsFromAsset (req,
try {
let elevate = req.query.elevate
const { assetId } = await getAssetInfoAndVerifyAccess(req)
let response = await AssetService.removeStigsFromAsset(assetId, elevate, req.userObject )
let response = await AssetService.removeStigsFromAsset(assetId, elevate, req.userObject, res.svcStatus)
res.json(response)
}
catch (err) {
Expand Down Expand Up @@ -663,7 +663,7 @@ module.exports.patchAssets = async function (req, res, next) {
if (!patchRequest.assetIds.every( a => collectionAssets.includes(a))) {
throw new SmError.PrivilegeError('One or more assetId is not a Collection member.')
}
await AssetService.deleteAssets(patchRequest.assetIds, req.userObject)
await AssetService.deleteAssets(patchRequest.assetIds, req.userObject, res.svcStatus)
res.json({
operation: 'deleted',
assetIds: patchRequest.assetIds
Expand Down
Loading

0 comments on commit 2622a4f

Please sign in to comment.