import { Request, Response, NextFunction } from 'express'
import { validate } from 'super-easy-validator'
import helpers from '../../utils/helpers'

async function postAlertViewed(req: Request, res: Response, next: NextFunction) {
	await helpers.runApi(res, () => {
		const { errors } = validate({ id: 'mongoid' } as any, req.params)
		if (errors) {
			return res.status(400).json({ message: errors[0] })
		}
		return next()
	})
}

const validations = {
	postAlertViewed,
}

export default validations
