mirror of
https://github.com/rjNemo/ticket_manager
synced 2026-06-12 11:46:40 +00:00
-
This commit is contained in:
parent
ebd3679651
commit
4428762398
2 changed files with 5 additions and 2 deletions
|
|
@ -32,7 +32,10 @@ namespace TicketManager.Controllers
|
||||||
[HttpGet("{id}")]
|
[HttpGet("{id}")]
|
||||||
public async Task<ActionResult<Project>> GetProject(int id)
|
public async Task<ActionResult<Project>> GetProject(int id)
|
||||||
{
|
{
|
||||||
var project = await _context.Projects.FindAsync(id);
|
var project = await _context.Projects
|
||||||
|
.Include(p => p.Assignments)
|
||||||
|
.FirstOrDefaultAsync(p => p.Id == id);
|
||||||
|
// .FindAsync(id);
|
||||||
|
|
||||||
if (project == null)
|
if (project == null)
|
||||||
{ return NotFound(); }
|
{ return NotFound(); }
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ namespace TicketManager.Models
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return (float)this.Tickets.
|
return Tickets.Count() == 0 ? 0 : (float)this.Tickets.
|
||||||
Where(t => t.Status == Status.Done).Count()
|
Where(t => t.Status == Status.Done).Count()
|
||||||
/ this.Tickets.Count()
|
/ this.Tickets.Count()
|
||||||
* 100;
|
* 100;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue