Fixed issues not loading

pull/3554/head
Jamie Rees 5 years ago
parent cdfe91e3a4
commit 7ca57f3666

@ -43,7 +43,7 @@ namespace Ombi.Hubs
}
var user = await _userManager.Users.
FirstOrDefaultAsync(x => x.Id.Equals(userIdClaim.Value, StringComparison.InvariantCultureIgnoreCase));
FirstOrDefaultAsync(x => x.Id == userIdClaim.Value);
var claims = await _userManager.GetRolesAsync(user);
UsersOnline.TryAdd(Context.ConnectionId, new HubUsers
{

@ -13,13 +13,14 @@ namespace Ombi.Store.Entities.Requests
public int? RequestId { get; set; }
public string Subject { get; set; }
public string Description { get; set; }
public int SeasonNumber { get; set; }
public int EpisodeNumber { get; set; }
//public int SeasonNumber { get; set; }
//public int EpisodeNumber { get; set; }
public int IssueCategoryId { get; set; }
[ForeignKey(nameof(IssueCategoryId))]
public IssueCategory IssueCategory { get; set; }
public IssueStatus Status { get; set; }
public DateTime? ResovledDate { get; set; }
public DateTime CreatedDate { get; set; }
[ForeignKey(nameof(UserReported))]
public string UserReportedId { get; set; }
public OmbiUser UserReported { get; set; }

@ -0,0 +1,24 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace Ombi.Store.Migrations.OmbiMySql
{
public partial class IssueCreatedDate : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<DateTime>(
name: "CreatedDate",
table: "Issues",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "CreatedDate",
table: "Issues");
}
}
}

@ -595,9 +595,6 @@ namespace Ombi.Store.Migrations.OmbiMySql
b.Property<string>("Description")
.HasColumnType("longtext CHARACTER SET utf8mb4");
b.Property<int>("EpisodeNumber")
.HasColumnType("int");
b.Property<int>("IssueCategoryId")
.HasColumnType("int");
@ -616,9 +613,6 @@ namespace Ombi.Store.Migrations.OmbiMySql
b.Property<DateTime?>("ResovledDate")
.HasColumnType("datetime(6)");
b.Property<int>("SeasonNumber")
.HasColumnType("int");
b.Property<int>("Status")
.HasColumnType("int");

@ -0,0 +1,24 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace Ombi.Store.Migrations.OmbiSqlite
{
public partial class IssueCreatedDate : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<DateTime>(
name: "CreatedDate",
table: "Issues",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "CreatedDate",
table: "Issues");
}
}
}

@ -591,11 +591,11 @@ namespace Ombi.Store.Migrations.OmbiSqlite
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("Description")
b.Property<DateTime>("CreatedDate")
.HasColumnType("TEXT");
b.Property<int>("EpisodeNumber")
.HasColumnType("INTEGER");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<int>("IssueCategoryId")
.HasColumnType("INTEGER");
@ -615,9 +615,6 @@ namespace Ombi.Store.Migrations.OmbiSqlite
b.Property<DateTime?>("ResovledDate")
.HasColumnType("TEXT");
b.Property<int>("SeasonNumber")
.HasColumnType("INTEGER");
b.Property<int>("Status")
.HasColumnType("INTEGER");

@ -130,7 +130,7 @@ namespace Ombi.Controllers.V1
public async Task<int> CreateIssue([FromBody]Issues i)
{
i.IssueCategory = null;
i.CreatedDate = DateTime.UtcNow;
var username = User.Identity.Name.ToUpper();
i.UserReportedId = (await _userManager.Users.FirstOrDefaultAsync(x => x.NormalizedUserName == username)).Id;
await _issues.Add(i);
@ -148,6 +148,7 @@ namespace Ombi.Controllers.V1
Recipient = string.Empty,
AdditionalInformation = $"{i.Subject} | {i.Description}",
UserId = i.UserReportedId,
};
AddIssueNotificationSubstitutes(notificationModel, i, User.Identity.Name);

Loading…
Cancel
Save