mirror of
https://github.com/DorkSquadRR/DorkNet.git
synced 2026-10-25 15:08:47 -07:00
feat: Update GetMine method to return a list of SettingDto instead of a dictionary
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user