fix: fix updateGroupConfig not work problem

replace value set with mongo set
pull/90/head
moonrailgun 2 years ago
parent bd5304cc5e
commit ff86b84c14

@ -437,9 +437,19 @@ class GroupService extends TcService {
throw new NoPermissionError(t('没有操作权限')); throw new NoPermissionError(t('没有操作权限'));
} }
const group = await this.adapter.model.findById(groupId).exec(); const group = await this.adapter.model.findOneAndUpdate(
group.config[configName] = configValue; {
await group.save(); _id: String(groupId),
},
{
$set: {
[`config.${configName}`]: configValue,
},
},
{
new: true,
}
);
this.notifyGroupInfoUpdate(ctx, group); this.notifyGroupInfoUpdate(ctx, group);
} }

Loading…
Cancel
Save