Skip to content

Commit

Permalink
core: handle booleanKeys in domain_edit
Browse files Browse the repository at this point in the history
  • Loading branch information
undefined-moe committed Dec 21, 2024
1 parent f024f75 commit 1123e02
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/hydrooj/src/handler/domain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ class DomainEditHandler extends ManageHandler {
async post(args) {
if (args.operation) return;
const $set = {};
const booleanKeys = args.booleanKeys || {};
delete args.booleanKeys;
for (const key in booleanKeys) if (!args[key]) $set[key] = false;
for (const key in args) {
if (DOMAIN_SETTINGS_BY_KEY[key]) $set[key] = args[key];
}
Expand Down

0 comments on commit 1123e02

Please sign in to comment.