|
|
|
@ -133,7 +133,11 @@ namespace Ombi.Controllers
|
|
|
|
|
i.IssueCategory = null;
|
|
|
|
|
i.UserReportedId = (await _userManager.Users.FirstOrDefaultAsync(x => x.UserName == User.Identity.Name)).Id;
|
|
|
|
|
await _issues.Add(i);
|
|
|
|
|
|
|
|
|
|
var category = await _categories.GetAll().FirstOrDefaultAsync(x => i.IssueCategoryId == x.Id);
|
|
|
|
|
if (category != null)
|
|
|
|
|
{
|
|
|
|
|
i.IssueCategory = category;
|
|
|
|
|
}
|
|
|
|
|
var notificationModel = new NotificationOptions
|
|
|
|
|
{
|
|
|
|
|
RequestId = i.RequestId ?? 0,
|
|
|
|
@ -142,7 +146,7 @@ namespace Ombi.Controllers
|
|
|
|
|
RequestType = i.RequestType,
|
|
|
|
|
Recipient = string.Empty,
|
|
|
|
|
AdditionalInformation = $"{i.Subject} | {i.Description}",
|
|
|
|
|
UserId = i.UserReportedId
|
|
|
|
|
UserId = i.UserReportedId,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
AddIssueNotificationSubstitutes(notificationModel, i, User.Identity.Name);
|
|
|
|
@ -195,7 +199,7 @@ namespace Ombi.Controllers
|
|
|
|
|
{
|
|
|
|
|
var user = await _userManager.Users.Where(x => User.Identity.Name == x.UserName)
|
|
|
|
|
.FirstOrDefaultAsync();
|
|
|
|
|
var issue = await _issues.GetAll().Include(x => x.UserReported).FirstOrDefaultAsync(x => x.Id == comment.IssueId);
|
|
|
|
|
var issue = await _issues.GetAll().Include(x => x.UserReported).Include(x => x.IssueCategory).FirstOrDefaultAsync(x => x.Id == comment.IssueId);
|
|
|
|
|
if (issue == null)
|
|
|
|
|
{
|
|
|
|
|
return null;
|
|
|
|
@ -242,7 +246,7 @@ namespace Ombi.Controllers
|
|
|
|
|
{
|
|
|
|
|
var user = await _userManager.Users.Where(x => User.Identity.Name == x.UserName)
|
|
|
|
|
.FirstOrDefaultAsync();
|
|
|
|
|
var issue = await _issues.GetAll().Include(x => x.UserReported).FirstOrDefaultAsync(x => x.Id == model.IssueId);
|
|
|
|
|
var issue = await _issues.GetAll().Include(x => x.UserReported).Include(x => x.IssueCategory).FirstOrDefaultAsync(x => x.Id == model.IssueId);
|
|
|
|
|
if (issue == null)
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|