added tesf for NaN in existance.groupExists
This commit is contained in:
		| @@ -3,7 +3,9 @@ import responseCodes from '../response/responseCodes.js'; | |||||||
| import GroupService from '../services/group.js'; | import GroupService from '../services/group.js'; | ||||||
|  |  | ||||||
| const groupExists = async (req, res, next) => { | const groupExists = async (req, res, next) => { | ||||||
|     let groupId = req.params.groupId || req.body.groupId; |     let groupId = Number(req.params.groupId || req.body.groupId); | ||||||
|  |  | ||||||
|  |     if (isNaN(groupId)) throw new customError(`groupId is not a number`, responseCodes.responses.groups.id_not_found) | ||||||
|  |  | ||||||
|     let group = await GroupService.getById(groupId); |     let group = await GroupService.getById(groupId); | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user