summaryrefslogtreecommitdiffstats
path: root/src/Pages/Index.cshtml.cs
diff options
context:
space:
mode:
authorivarlovlie <git@ivarlovlie.no>2022-11-15 06:20:30 +0100
committerivarlovlie <git@ivarlovlie.no>2022-11-15 06:20:30 +0100
commitaa1e0e321ad64b72d80efcb7984acdf1cd3d6b7a (patch)
tree4abce617ce12dea1ebe9f030d93ebb5f4407cad8 /src/Pages/Index.cshtml.cs
parentadd94527050dc311c4ad117e25dd5e4517b3b887 (diff)
downloadlettnytt-aa1e0e321ad64b72d80efcb7984acdf1cd3d6b7a.tar.xz
lettnytt-aa1e0e321ad64b72d80efcb7984acdf1cd3d6b7a.zip
refactor: Add some styling
Diffstat (limited to 'src/Pages/Index.cshtml.cs')
-rw-r--r--src/Pages/Index.cshtml.cs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Pages/Index.cshtml.cs b/src/Pages/Index.cshtml.cs
index 9305766..80b0ed0 100644
--- a/src/Pages/Index.cshtml.cs
+++ b/src/Pages/Index.cshtml.cs
@@ -16,15 +16,15 @@ public class IndexModel : PageModel
public NewsSource Source { get; set; }
public async Task<ActionResult> OnGet(string site) {
- if (site.IsNullOrWhiteSpace()) {
- return Redirect("/nrk");
- }
-
Source = site switch {
"nrk" => await _grabber.GrabNrkAsync(),
- _ => await _grabber.GrabNrkAsync()
+ _ => default
};
+ if (Source == default) {
+ return Redirect("/nrk");
+ }
+
return Page();
}
} \ No newline at end of file