Finished the notes! Resolved #7

This commit is contained in:
Jamie Rees 2016-03-15 19:14:27 +00:00
commit a2f44cf8d2
10 changed files with 40 additions and 28 deletions

View file

@ -118,7 +118,7 @@ namespace PlexRequests.UI.Modules
var settings = AuthSettings.GetSettings();
if (settings?.PlexAuthToken == null)
{
return Response.AsJson(new JsonResponseModel { Result = false, Message = "Plex is not setup yet, we need " });
return Response.AsJson(new JsonResponseModel { Result = false, Message = "Plex is not setup yet, you need to update your Authentication settings" });
}
try
{

View file

@ -86,12 +86,14 @@ namespace PlexRequests.UI.Modules
Post["/register"] = x =>
{
var username = (string) Request.Form.Username;
var exists = UserMapper.DoUsersExist();
if (exists)
{
return Context.GetRedirect("~/register?error=true&username=" + (string)Request.Form.Username);
return Context.GetRedirect("~/register?error=true&username=" + username);
}
var userId = UserMapper.CreateUser(Request.Form.Username, Request.Form.Password);
var userId = UserMapper.CreateUser(username, Request.Form.Password);
Session[SessionKeys.UsernameKey] = username;
return this.LoginAndRedirect((Guid)userId);
};
}

View file

@ -61,7 +61,7 @@ namespace PlexRequests.UI.Modules
Post["/clearissues"] = _ => ClearIssue((int)Request.Form.Id);
Post["/changeavailability"] = _ => ChangeRequestAvailability((int)Request.Form.Id, (bool)Request.Form.Available);
Post["/addnote"] = _ => AddNote((int)Request.Form.Id, (string)Request.Form.noteArea);
Post["/addnote"] = _ => AddNote((int)Request.Form.requestId, (string)Request.Form.noteArea);
}
private IRepository<RequestedModel> Service { get; }
@ -213,7 +213,7 @@ namespace PlexRequests.UI.Modules
var originalRequest = Service.Get(requestId);
if (originalRequest == null)
{
return Response.AsJson(new JsonResponseModel { Result = false, Message = "Request does not exist to change the availability!" });
return Response.AsJson(new JsonResponseModel { Result = false, Message = "Request does not exist to add a note!" });
}
originalRequest.AdminNote = noteArea;