fixed ThemeController not handling empty-theme (default) properly
This commit is contained in:
parent
5192c9af7a
commit
0b18e1ac7e
|
@ -5,8 +5,14 @@ namespace Wave.Controllers;
|
||||||
[ApiController]
|
[ApiController]
|
||||||
[Route("/theme")]
|
[Route("/theme")]
|
||||||
public class ThemeController : ControllerBase {
|
public class ThemeController : ControllerBase {
|
||||||
|
[HttpGet("")]
|
||||||
|
public IActionResult SetTheme(string returnUrl = "") {
|
||||||
|
Response.Cookies.Delete(".Wave.Theme");
|
||||||
|
return LocalRedirect(string.IsNullOrWhiteSpace(returnUrl) ? "/" : returnUrl);
|
||||||
|
}
|
||||||
|
|
||||||
[HttpGet("{theme}")]
|
[HttpGet("{theme}")]
|
||||||
public IActionResult SetLanguage(string? theme, string returnUrl = "") {
|
public IActionResult SetTheme(string? theme, string returnUrl = "") {
|
||||||
if (theme is null) {
|
if (theme is null) {
|
||||||
Response.Cookies.Delete(".Wave.Theme");
|
Response.Cookies.Delete(".Wave.Theme");
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue