|
|
|
@ -132,7 +132,7 @@ namespace Ombi.Controllers
|
|
|
|
|
public async Task<int> CreateIssue([FromBody]Issues i)
|
|
|
|
|
{
|
|
|
|
|
i.IssueCategory = null;
|
|
|
|
|
i.UserReportedId = (await _userManager.Users.FirstOrDefaultAsync(x => x.UserName == User.Identity.Name)).Id;
|
|
|
|
|
i.UserReportedId = (await _userManager.Users.FirstOrDefaultAsync(x => x.UserName.Equals(User.Identity.Name, StringComparison.InvariantCultureIgnoreCase))).Id;
|
|
|
|
|
await _issues.Add(i);
|
|
|
|
|
var category = await _categories.GetAll().FirstOrDefaultAsync(x => i.IssueCategoryId == x.Id);
|
|
|
|
|
if (category != null)
|
|
|
|
@ -199,7 +199,7 @@ namespace Ombi.Controllers
|
|
|
|
|
[HttpPost("comments")]
|
|
|
|
|
public async Task<IssueComments> AddComment([FromBody] NewIssueCommentViewModel comment)
|
|
|
|
|
{
|
|
|
|
|
var user = await _userManager.Users.Where(x => User.Identity.Name == x.UserName)
|
|
|
|
|
var user = await _userManager.Users.Where(x => User.Identity.Name.Equals(x.UserName, StringComparison.InvariantCultureIgnoreCase))
|
|
|
|
|
.FirstOrDefaultAsync();
|
|
|
|
|
var issue = await _issues.GetAll().Include(x => x.UserReported).Include(x => x.IssueCategory).FirstOrDefaultAsync(x => x.Id == comment.IssueId);
|
|
|
|
|
if (issue == null)
|
|
|
|
@ -258,7 +258,7 @@ namespace Ombi.Controllers
|
|
|
|
|
[HttpPost("status")]
|
|
|
|
|
public async Task<bool> UpdateStatus([FromBody] IssueStateViewModel model)
|
|
|
|
|
{
|
|
|
|
|
var user = await _userManager.Users.Where(x => User.Identity.Name == x.UserName)
|
|
|
|
|
var user = await _userManager.Users.Where(x => User.Identity.Name.Equals(x.UserName, StringComparison.InvariantCultureIgnoreCase))
|
|
|
|
|
.FirstOrDefaultAsync();
|
|
|
|
|
var issue = await _issues.GetAll().Include(x => x.UserReported).Include(x => x.IssueCategory).FirstOrDefaultAsync(x => x.Id == model.IssueId);
|
|
|
|
|
if (issue == null)
|
|
|
|
|