C'est un pAPI.

This commit is contained in:
MarcEricMartel
2022-11-05 07:55:09 -07:00
parent 0b7b9689b1
commit 4608cb5de8
5 changed files with 230 additions and 9 deletions

View File

@@ -55,10 +55,10 @@ public class InvoiceController : Controller {
roles = new List<string>();
}
try { // TODO: Débugger ça.
try {
id = _signInMan.Context.User.Identity.GetUserId();
if (all is not null && all == true && roles.Contains("Administrateur"))
return Ok(_context.Invoices/*.Include("LinkedAccount").Include("ShippingAddress"/*"LinkedAccount, ShippingAddress")*/.ToList());
return Ok(_context.Invoices.ToList());
else return Ok(_context.Invoices.Include("ShippingAddress").Where(x => x.LinkedAccount != null &&
x.LinkedAccount.Id == id).ToList());
} catch (Exception e) {