mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-07 21:51:13 -07:00
Finished #209
This commit is contained in:
parent
5ada81ceb5
commit
03c7585ebe
16 changed files with 307 additions and 328 deletions
|
@ -209,10 +209,23 @@ namespace PlexRequests.UI.Modules
|
|||
private Response SaveAdmin()
|
||||
{
|
||||
var model = this.Bind<PlexRequestSettings>();
|
||||
var valid = this.Validate (model);
|
||||
if (!valid.IsValid) {
|
||||
return Response.AsJson(valid.SendJsonError());
|
||||
}
|
||||
|
||||
PrService.SaveSettings(model);
|
||||
if (!string.IsNullOrWhiteSpace (model.BaseUrl)) {
|
||||
if (model.BaseUrl.StartsWith ("/") || model.BaseUrl.StartsWith ("\\"));
|
||||
{
|
||||
model.BaseUrl = model.BaseUrl.Remove (0, 1);
|
||||
}
|
||||
}
|
||||
var result = PrService.SaveSettings(model);
|
||||
if (result) {
|
||||
return Response.AsJson (new JsonResponseModel{ Result = true });
|
||||
}
|
||||
|
||||
return Context.GetRedirect(!string.IsNullOrEmpty(BaseUrl) ? $"~/{BaseUrl}/admin" : "~/admin");
|
||||
return Response.AsJson (new JsonResponseModel{ Result = false, Message = "We could not save to the database, please try again" });
|
||||
}
|
||||
|
||||
private Response RequestAuthToken()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue