mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-16 22:27:26 +01:00
task types: add new error messages for invalid task types (#9983)
* `/task/user` `GET` endpoint takes plurals of task types as allowed parameters, plus another custom `completedTodos` type * `/tasks/group/:groupId` and `/tasks/challenge/:challengeId` `GET` endpoints task plurals of task types as allowed parameters
This commit is contained in:
committed by
Sabe Jones
parent
b850ea9dbf
commit
4b17f62241
@@ -86,7 +86,7 @@ api.getGroupTasks = {
|
||||
middlewares: [authWithHeaders()],
|
||||
async handler (req, res) {
|
||||
req.checkParams('groupId', res.t('groupIdRequired')).notEmpty().isUUID();
|
||||
req.checkQuery('type', res.t('invalidTaskType')).optional().isIn(types);
|
||||
req.checkQuery('type', res.t('invalidTasksType')).optional().isIn(types);
|
||||
|
||||
let validationErrors = req.validationErrors();
|
||||
if (validationErrors) throw validationErrors;
|
||||
|
||||
Reference in New Issue
Block a user