aboutsummaryrefslogtreecommitdiffstats
path: root/src/Endpoints/GetRadioSeriesList.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Endpoints/GetRadioSeriesList.cs')
-rw-r--r--src/Endpoints/GetRadioSeriesList.cs14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/Endpoints/GetRadioSeriesList.cs b/src/Endpoints/GetRadioSeriesList.cs
index 7898f25..1005a45 100644
--- a/src/Endpoints/GetRadioSeriesList.cs
+++ b/src/Endpoints/GetRadioSeriesList.cs
@@ -6,8 +6,18 @@ public class RadioSearchEndpoint : EndpointBase
{
public RadioSearchEndpoint() { }
+ public class Response
+ {
+ public int Id { get; set; }
+ public string Name { get; set; }
+ }
+
[HttpGet("~/radio-series")]
- public async Task<ActionResult> HandleAsync(string q) {
- return Ok(RadioIndexDb.GetSeries(q));
+ public async Task<ActionResult<List<Response>>> HandleAsync(string q) {
+ var series = RadioIndexDb.GetSeries(q);
+ return Ok(series.Select(c => new Response() {
+ Id = c.Id,
+ Name = c.Name
+ }));
}
} \ No newline at end of file