Skip to content

Commit af3b069

Browse files
Update controllers/members.js
Co-authored-by: Sunny Sahsi <[email protected]>
1 parent f6d028d commit af3b069

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

controllers/members.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,9 @@ const archiveMembers = async (req, res) => {
9191
superUserId: superUserId,
9292
username: username,
9393
};
94-
if (!body?.reason || /^\s*$/.test(body?.reason)) {
94+
const isReasonNullOrUndefined = !body?.reason;
95+
const isReasonEmptyOrWhitespace = /^\s*$/.test(body?.reason);
96+
if (isReasonNullOrUndefined || isReasonEmptyOrWhitespace) {
9597
return res.boom.badRequest("Reason is required");
9698
}
9799
if (user?.userExists) {

0 commit comments

Comments
 (0)