import UserMiddleware from "../Middleware/UserAuthorization";
import MonitorService from "../Services/MonitorService";
import Response from "../Utils/Response";
import BaseAPI from "./BaseAPI";
import Monitor from "../../Models/DatabaseModels/Monitor";
import ObjectID from "../../Types/ObjectID";
export default class MonitorAPI extends BaseAPI {
    constructor() {
        var _a;
        super(Monitor, MonitorService);
        this.router.get(`${(_a = new this.entityType().getCrudApiPath()) === null || _a === void 0 ? void 0 : _a.toString()}/refresh-status/:monitorId`, UserMiddleware.getUserMiddleware, async (req, res, next) => {
            try {
                const monitorId = new ObjectID(req.params["monitorId"]);
                await MonitorService.refreshMonitorCurrentStatus(monitorId);
                return Response.sendEmptySuccessResponse(req, res);
            }
            catch (e) {
                next(e);
            }
        });
    }
}
//# sourceMappingURL=MonitorAPI.js.map