mirror of
https://github.com/rjNemo/ticket_manager
synced 2026-06-06 00:36:39 +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}")]
|
||||
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)
|
||||
{ return NotFound(); }
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ namespace TicketManager.Models
|
|||
{
|
||||
get
|
||||
{
|
||||
return (float)this.Tickets.
|
||||
return Tickets.Count() == 0 ? 0 : (float)this.Tickets.
|
||||
Where(t => t.Status == Status.Done).Count()
|
||||
/ this.Tickets.Count()
|
||||
* 100;
|
||||
|
|
|
|||
Loading…
Reference in a new issue