Skip to content

Commit

Permalink
Merge pull request #165 from dfinity/fix-remove-moderator
Browse files Browse the repository at this point in the history
Implement moderator removal
  • Loading branch information
rvanasa authored Apr 10, 2024
2 parents 8babd31 + abc067f commit ef01948
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion backend/Core.mo
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,11 @@ module {
let log = logger.Begin(caller, #setUserIsModerator { user = #user id; isMod });
assertCallerIsModerator(log, caller)!;
assertUserExists(log, #user id)!;
state.userIsModerator.put(#user id);
if (isMod) {
state.userIsModerator.put(#user id);
} else {
state.userIsModerator.remove(#user id);
};
log.ok()!;
};
};
Expand Down

0 comments on commit ef01948

Please sign in to comment.