diff --git a/Server/controllers/monitorController.js b/Server/controllers/monitorController.js index 613027f53..aa73de18d 100644 --- a/Server/controllers/monitorController.js +++ b/Server/controllers/monitorController.js @@ -104,6 +104,19 @@ class MonitorController { } }; + getHardwareDetailsById = async (req, res, next) => { + try { + const monitor = await this.db.getHardwareDetailsById(req); + return res.status(200).json({ + success: true, + msg: successMessages.MONITOR_GET_BY_ID, + data: monitor, + }); + } catch (error) { + next(handleError(error, SERVICE_NAME, "getHardwareDetailsById")); + } + }; + getMonitorCertificate = async (req, res, next, fetchMonitorCertificate) => { try { await getCertificateParamValidation.validateAsync(req.params); diff --git a/Server/routes/monitorRoute.js b/Server/routes/monitorRoute.js index c3257372b..9decd4339 100644 --- a/Server/routes/monitorRoute.js +++ b/Server/routes/monitorRoute.js @@ -13,6 +13,10 @@ class MonitorRoutes { this.router.get("/", this.monitorController.getAllMonitors); this.router.get("/uptime", this.monitorController.getAllMonitorsWithUptimeStats); this.router.get("/stats/:monitorId", this.monitorController.getMonitorStatsById); + this.router.get( + "/hardware/details/:monitorId", + this.monitorController.getHardwareDetailsById + ); this.router.get("/certificate/:monitorId", (req, res, next) => { this.monitorController.getMonitorCertificate( req,