diff options
| author | ivarlovlie <git@ivarlovlie.no> | 2022-12-05 04:04:39 +0100 |
|---|---|---|
| committer | ivarlovlie <git@ivarlovlie.no> | 2022-12-05 04:05:05 +0100 |
| commit | 0a7254b7fa0871a9e7db24c10ac55d5f76ad0e61 (patch) | |
| tree | 552a3e530a857284a9a0a31089bc9086445c6a9a /src/Endpoints | |
| parent | 8542e0655a1954c56c8312c47b8f93f81ddfd88f (diff) | |
| download | lettnytt-0a7254b7fa0871a9e7db24c10ac55d5f76ad0e61.tar.xz lettnytt-0a7254b7fa0871a9e7db24c10ac55d5f76ad0e61.zip | |
feat: !WIP frontend for nrk radio
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 |
