From c3dca8edefe0e83271e164476010a164e0604f90 Mon Sep 17 00:00:00 2001 From: Ruidy Nemausat Date: Mon, 20 Apr 2020 16:05:55 +0200 Subject: [PATCH] fix NewTicketDTO type mismatch in Enums --- Controllers/TicketsController.cs | 3 +++ Resources/Tickets/NewTicketDTO.cs | 6 +++--- app.db | Bin 106496 -> 106496 bytes .../src/components/Modals/NewTicketModal.tsx | 1 - 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Controllers/TicketsController.cs b/Controllers/TicketsController.cs index 78891dd..6a447b7 100644 --- a/Controllers/TicketsController.cs +++ b/Controllers/TicketsController.cs @@ -105,6 +105,9 @@ namespace TicketManager.Controllers Description = ticketDto.Description, EndingDate = ticketDto.EndingDate, CreatorId = ticketDto.CreatorId, + Category = (Category)ticketDto.Category, + Impact = (Impact)ticketDto.Impact, + Difficulty = (Difficulty)ticketDto.Difficulty, Project = await _context.Projects.FindAsync(ticketDto.ProjectId) }; diff --git a/Resources/Tickets/NewTicketDTO.cs b/Resources/Tickets/NewTicketDTO.cs index a8ebb28..c1e01bb 100644 --- a/Resources/Tickets/NewTicketDTO.cs +++ b/Resources/Tickets/NewTicketDTO.cs @@ -16,11 +16,11 @@ namespace TicketManager.Resources [DataType(DataType.Date)] public DateTime EndingDate { get; set; } - public string Impact { get; set; } + public int Impact { get; set; } - public string Difficulty { get; set; } + public int Difficulty { get; set; } - public string Category { get; set; } + public int Category { get; set; } [Required] public Guid CreatorId { get; set; } [Required] diff --git a/app.db b/app.db index 562fdf60a4898452d344f0ca2fb381ff27004b24..db588efd185009c6d5b1ada8e2b639e9403f2345 100644 GIT binary patch delta 190 zcmZoTz}9epZNvY3M)pkwEDHQ=JP#T8-tyk!4d83wpTM(Sa025w9UIuYlM`KP- zPR3A1hLF_alH$nxQibfi@_Zu$BLiIn6I~+%1w%6{10yR_V?9Gd6BBb|n2e#hf`Ne* z7_m&gJzs^9WplvXEsq4)`0p|Bf9LXKK<{M;_7CB+5g^YGm*JlQAITOW>i_@% diff --git a/client/src/components/Modals/NewTicketModal.tsx b/client/src/components/Modals/NewTicketModal.tsx index 97ee1be..34afeea 100644 --- a/client/src/components/Modals/NewTicketModal.tsx +++ b/client/src/components/Modals/NewTicketModal.tsx @@ -8,7 +8,6 @@ import { Theme, } from "@material-ui/core"; import Modal from "./Modal"; -import Ticket from "../../types/Ticket"; import Project from "../../types/Project"; import Category from "../../types/enums/category"; import Impact from "../../types/enums/impact";