fixed ThemeController not handling empty-theme (default) properly

This commit is contained in:
Mia Rose Winter 2024-01-25 13:35:49 +01:00
parent 5192c9af7a
commit 0b18e1ac7e
Signed by: miawinter
GPG key ID: 4B6F6A83178F595E

View file

@ -5,8 +5,14 @@ namespace Wave.Controllers;
[ApiController]
[Route("/theme")]
public class ThemeController : ControllerBase {
[HttpGet("")]
public IActionResult SetTheme(string returnUrl = "") {
Response.Cookies.Delete(".Wave.Theme");
return LocalRedirect(string.IsNullOrWhiteSpace(returnUrl) ? "/" : returnUrl);
}
[HttpGet("{theme}")]
public IActionResult SetLanguage(string? theme, string returnUrl = "") {
public IActionResult SetTheme(string? theme, string returnUrl = "") {
if (theme is null) {
Response.Cookies.Delete(".Wave.Theme");
} else {