feat: Update GetMine method to return a list of SettingDto instead of a dictionary

This commit is contained in:
Alexa
2026-06-23 00:29:11 +03:00
parent df73507ee9
commit 142f52569a
@@ -19,12 +19,13 @@ public class PlayerSettingsController(DorkNetDbContext db) : ControllerBase
private long CurrentPlayerId => this.RequireCurrentPlayerId();
[HttpGet("/playersettings")]
public async Task<ActionResult<Dictionary<string, string>>> GetMine()
public async Task<ActionResult<List<SettingDto>>> GetMine()
{
var accountId = CurrentPlayerId;
var settings = await db.PlayerSettings
.Where(s => s.PlayerId == accountId)
.ToDictionaryAsync(s => s.Key, s => s.Value);
.Select(s => new SettingDto { Key = s.Key, Value = s.Value })
.ToListAsync();
return Ok(settings);
}