We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f6d028d commit af3b069Copy full SHA for af3b069
controllers/members.js
@@ -91,7 +91,9 @@ const archiveMembers = async (req, res) => {
91
superUserId: superUserId,
92
username: username,
93
};
94
- if (!body?.reason || /^\s*$/.test(body?.reason)) {
+ const isReasonNullOrUndefined = !body?.reason;
95
+ const isReasonEmptyOrWhitespace = /^\s*$/.test(body?.reason);
96
+ if (isReasonNullOrUndefined || isReasonEmptyOrWhitespace) {
97
return res.boom.badRequest("Reason is required");
98
}
99
if (user?.userExists) {
0 commit comments