diff options
Diffstat (limited to 'src/Endpoints')
| -rw-r--r-- | src/Endpoints/CreateRadioIndex.cs | 18 | ||||
| -rw-r--r-- | src/Endpoints/GetRadioSeriesList.cs | 13 |
2 files changed, 13 insertions, 18 deletions
diff --git a/src/Endpoints/CreateRadioIndex.cs b/src/Endpoints/CreateRadioIndex.cs deleted file mode 100644 index 1ef19ab..0000000 --- a/src/Endpoints/CreateRadioIndex.cs +++ /dev/null @@ -1,18 +0,0 @@ -using Microsoft.AspNetCore.Mvc; - -namespace I2R.LightNews.Endpoints; - -public class RadioSearchEndpoint : EndpointBase -{ - private readonly NrkRadioService _radio; - - public RadioSearchEndpoint(NrkRadioService radio) { - _radio = radio; - } - - [HttpGet("~/create-radio-index")] - public async Task<ActionResult> HandleASync() { - await _radio.CreateIndex(); - return Ok(); - } -}
\ No newline at end of file diff --git a/src/Endpoints/GetRadioSeriesList.cs b/src/Endpoints/GetRadioSeriesList.cs new file mode 100644 index 0000000..7898f25 --- /dev/null +++ b/src/Endpoints/GetRadioSeriesList.cs @@ -0,0 +1,13 @@ +using Microsoft.AspNetCore.Mvc; + +namespace I2R.LightNews.Endpoints; + +public class RadioSearchEndpoint : EndpointBase +{ + public RadioSearchEndpoint() { } + + [HttpGet("~/radio-series")] + public async Task<ActionResult> HandleAsync(string q) { + return Ok(RadioIndexDb.GetSeries(q)); + } +}
\ No newline at end of file |
