feat: allow API checkRequired middleware error to be internationalized

isekai-main
Julian Lam 3 years ago
parent c990211cf2
commit 74f1905ea8

@ -2,6 +2,7 @@
"invalid-data": "Invalid Data",
"invalid-json": "Invalid JSON",
"array-expected": "A value of type Array was expected for property `%1`, but %2 was received instead",
"required-parameters-missing": "Required parameters were missing from this API call: %1",
"not-logged-in": "You don't seem to be logged in.",
"account-locked": "Your account has been locked temporarily",

@ -255,5 +255,5 @@ middleware.checkRequired = function (fields, req, res, next) {
return next();
}
controllers.helpers.formatApiResponse(400, res, new Error(`Required parameters were missing from this API call: ${missing.join(', ')}`));
controllers.helpers.formatApiResponse(400, res, new Error(`[[error:required-parameters-missing, ${missing.join(' ')}]]`));
};

Loading…
Cancel
Save