mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 11:35:55 +01:00
feat: allow API checkRequired middleware error to be internationalized
This commit is contained in:
@@ -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(' ')}]]`));
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user