This PR removes the camerasStatusBodyValidators middleware from the "/cameras/status" endpoint.
The middleware was previously used to validate the request body for the POST route. However, it was found that the middleware was causing issues when any camera asset under the same middleware was misconfigured. This led to the middleware incorrectly marking all assets as 'down'.
To resolve this, the validation has been removed from the middleware and instead added directly within the fetchCameraStatuses function in the CameraController. This allows the function to ignore any misconfigured assets and continue processing the remaining assets.
The changes in this PR include:
Removal of camerasStatusBodyValidators from cameraValidators.js
Removal of validate(camerasStatusBodyValidators) from the POST route in cameraRouter.js
Fixes #98
This PR removes the
camerasStatusBodyValidators
middleware from the "/cameras/status" endpoint.The middleware was previously used to validate the request body for the POST route. However, it was found that the middleware was causing issues when any camera asset under the same middleware was misconfigured. This led to the middleware incorrectly marking all assets as 'down'.
To resolve this, the validation has been removed from the middleware and instead added directly within the
fetchCameraStatuses
function in theCameraController
. This allows the function to ignore any misconfigured assets and continue processing the remaining assets.The changes in this PR include:
camerasStatusBodyValidators
fromcameraValidators.js
validate(camerasStatusBodyValidators)
from the POST route incameraRouter.js