diff --git a/backend/Levels/Controllers/LevelsConfigController.cs b/backend/Levels/Controllers/LevelsConfigController.cs index 29031acf3..4124ec621 100644 --- a/backend/Levels/Controllers/LevelsConfigController.cs +++ b/backend/Levels/Controllers/LevelsConfigController.cs @@ -30,7 +30,37 @@ public async Task GetConfig([FromRoute] ulong guildId) } var config = await _levelsConfigRepository.GetOrCreateConfig(guildId); - return Ok(config); + + var dto = new GuildLevelConfigDto + { + Id = guildId, + + Coefficients = config.Coefficients, + XpInterval = config.XpInterval, + + MaximumTextXpGiven = config.Experience.MaximumTextXpGiven, + MaximumVoiceXpGiven = config.Experience.MaximumVoiceXpGiven, + MinimumTextXpGiven = config.Experience.MinimumTextXpGiven, + MinimumVoiceXpGiven = config.Experience.MinimumVoiceXpGiven, + + VoiceXpRequiredMembers = config.VoiceXpRequiredMembers, + VoiceXpCountMutedMembers = config.VoiceXpCountMutedMembers, + + HandleRoles = config.HandleRoles, + NicknameDisabledRole = config.NicknameDisabledRole, + NicknameDisabledReplacement = config.NicknameDisabledReplacement, + Levels = config.Levels, + LevelUpMessageOverrides = config.LevelUpMessageOverrides, + DisabledXpChannels = config.DisabledXpChannels, + + LevelUpTemplate = config.LevelUpTemplate, + SendTextLevelUps = config.SendTextLevelUps, + SendVoiceLevelUps = config.SendVoiceLevelUps, + TextLevelUpChannel = config.TextLevelUpChannel, + VoiceLevelUpChannel = config.VoiceLevelUpChannel + }; + + return Ok(dto); } [HttpPut] @@ -87,9 +117,6 @@ public async Task PutConfig([FromRoute] ulong guildId, [FromBody] existing.TextLevelUpChannel = config.TextLevelUpChannel; existing.VoiceLevelUpChannel = config.VoiceLevelUpChannel; - existing.Levels = config.Levels; - existing.LevelUpMessageOverrides = config.LevelUpMessageOverrides; - await _levelsConfigRepository.UpdateConfig(existing); return Ok(); }