mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-11 07:46:05 -07:00
Settings done for #298
This commit is contained in:
parent
0dd30968d5
commit
66bede34f4
4 changed files with 45 additions and 36 deletions
|
@ -191,7 +191,7 @@ namespace PlexRequests.UI.Modules
|
|||
Post["/slacknotification"] = _ => SaveSlackNotifications();
|
||||
|
||||
Get["/landingpage", true] = async (x,ct) => await LandingPage();
|
||||
Post["/landingpage"] = _ => SaveSlackNotifications();
|
||||
Post["/landingpage", true] = async (x, ct) => await SaveLandingPage();
|
||||
}
|
||||
|
||||
private Negotiator Authentication()
|
||||
|
@ -819,5 +819,21 @@ namespace PlexRequests.UI.Modules
|
|||
|
||||
return View["LandingPage", settings];
|
||||
}
|
||||
|
||||
private async Task<Response> SaveLandingPage()
|
||||
{
|
||||
var settings = this.Bind<LandingPageSettings>();
|
||||
|
||||
if (settings.Enabled && settings.EnabledNoticeTime && string.IsNullOrEmpty(settings.NoticeMessage))
|
||||
{
|
||||
return Response.AsJson(new JsonResponseModel { Result = false, Message = "If you are going to enabled the notice, then we need a message!"});
|
||||
}
|
||||
|
||||
var result = await LandingSettings.SaveSettingsAsync(settings);
|
||||
|
||||
return Response.AsJson(result
|
||||
? new JsonResponseModel { Result = true }
|
||||
: new JsonResponseModel { Result = false, Message = "Could not save to Db Please check the logs"});
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue