[chore]: renamed Ressources/Tickets -> Ticket

This commit is contained in:
Ruidy Nemausat 2020-04-17 13:37:34 +02:00
parent 2c8ce46a75
commit c8908b0bfe
8 changed files with 13 additions and 9 deletions

View file

@ -200,7 +200,7 @@ namespace TicketManager.Controllers
}
[HttpGet("{id}/projects")]
public async Task<ActionResult<IEnumerable<ProjectDTORequest>>> GetAppUserProjects(Guid id)
public async Task<ActionResult<IEnumerable<ProjectDTORead>>> GetAppUserProjects(Guid id)
{
var user = await _context.AppUsers
.Include(u => u.Assignments)
@ -211,7 +211,7 @@ namespace TicketManager.Controllers
{
return BadRequest();
}
return user.GetProjects().Select(p => new ProjectDTORequest(p)).ToList();
return user.GetProjects().Select(p => new ProjectDTORead(p)).ToList();
}
[HttpGet("{id}/tickets/")]

View file

@ -19,7 +19,7 @@ namespace TicketManager.Resources
CreationDate = user.CreationDate;
Picture = user.Picture;
Activities = user.Activities;
Projects = user.GetProjects().Select(u => new ProjectDTORequest(u)).ToList();
Projects = user.GetProjects().Select(u => new ProjectDTORead(u)).ToList();
Tickets = user.GetTickets().Select(u => new TicketDTORead(u)).ToList();
}
@ -46,7 +46,7 @@ namespace TicketManager.Resources
public List<Activity> Activities { get; set; } = new List<Activity>();
public List<ProjectDTORequest> Projects { get; set; } = new List<ProjectDTORequest>();
public List<ProjectDTORead> Projects { get; set; } = new List<ProjectDTORead>();
public List<TicketDTORead> Tickets { get; set; } = new List<TicketDTORead>();
}

View file

@ -5,9 +5,9 @@ using TicketManager.Models;
namespace TicketManager.Resources
{
public class ProjectDTORequest
public class ProjectDTORead
{
public ProjectDTORequest(Project project)
public ProjectDTORead(Project project)
{
Id = project.Id;
Title = project.Title;

View file

@ -20,7 +20,7 @@ namespace TicketManager.Resources
Difficulty = ticket.Difficulty.ToString();
Category = ticket.Category.ToString();
CreatorId = ticket.CreatorId;
Project = ticket.Project != null ? new ProjectDTORequest(ticket.Project) : null;
Project = ticket.Project != null ? new ProjectDTORead(ticket.Project) : null;
Notes = ticket.Notes;
Activities = ticket.Activities;
Files = ticket.Files;
@ -49,7 +49,7 @@ namespace TicketManager.Resources
public Guid CreatorId { get; set; }
public ProjectDTORequest Project { get; set; }
public ProjectDTORead Project { get; set; }
public List<Note> Notes { get; set; } = new List<Note>();

View file

@ -158,7 +158,7 @@ namespace TicketManager.Tests
await context.SaveChangesAsync();
// result = await controller.PatchProject(1,
// new ProjectDTORequest()
// new ProjectDTORead()
// {
// Id = 1,
// Title = "Top Secret Project",

View file

@ -0,0 +1,4 @@
{
"domain": "dev-fyjrvohx.auth0.com",
"clientId": "NOTxfOhjCLkdvsstLm2tcS1kiAjCdWm9"
}