From 297a1a0f3ded1f26ee14a76e35d74776cbec2bbb Mon Sep 17 00:00:00 2001 From: TypoMustakes Date: Tue, 5 Dec 2023 14:37:49 +0100 Subject: [PATCH] Modifying endpoint routes to make more sense --- .../Controllers/CustomerController.cs | 2 +- .../Controllers/EmployeeController.cs | 8 +++++++- .../Controllers/MaintainerTeamController.cs | 2 +- .../Controllers/ServiceController.cs | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/WD7UVN_HFT_2023241.Endpoint/Controllers/CustomerController.cs b/WD7UVN_HFT_2023241.Endpoint/Controllers/CustomerController.cs index d452147..0cd5daa 100644 --- a/WD7UVN_HFT_2023241.Endpoint/Controllers/CustomerController.cs +++ b/WD7UVN_HFT_2023241.Endpoint/Controllers/CustomerController.cs @@ -6,7 +6,7 @@ using WD7UVN_HFT_2023241.Models; namespace WD7UVN_HFT_2023241.Endpoint { [ApiController] - [Route("api/database")] + [Route("api/Customer")] public class CustomerController : ControllerBase { public ILogicServices LogicServices { get; set; } diff --git a/WD7UVN_HFT_2023241.Endpoint/Controllers/EmployeeController.cs b/WD7UVN_HFT_2023241.Endpoint/Controllers/EmployeeController.cs index ebcaa8e..d81ffc4 100644 --- a/WD7UVN_HFT_2023241.Endpoint/Controllers/EmployeeController.cs +++ b/WD7UVN_HFT_2023241.Endpoint/Controllers/EmployeeController.cs @@ -6,7 +6,7 @@ using WD7UVN_HFT_2023241.Models; namespace WD7UVN_HFT_2023241.Endpoint { [ApiController] - [Route("api/database")] + [Route("api/Employee")] public class EmployeeController : ControllerBase { public ILogicServices LogicServices { get; set; } @@ -22,6 +22,12 @@ namespace WD7UVN_HFT_2023241.Endpoint return LogicServices.GetSubordinates(id); } + [HttpGet("WhoWorksInMaintainerTeam/{id}")] + public IQueryable WhoWorksInMaintainerTeam(int id) + { + return LogicServices.WhoWorksInMaintainerTeam(id); + } + [HttpGet()] public IActionResult ReadAllEmployees() { diff --git a/WD7UVN_HFT_2023241.Endpoint/Controllers/MaintainerTeamController.cs b/WD7UVN_HFT_2023241.Endpoint/Controllers/MaintainerTeamController.cs index 0ead984..85dab59 100644 --- a/WD7UVN_HFT_2023241.Endpoint/Controllers/MaintainerTeamController.cs +++ b/WD7UVN_HFT_2023241.Endpoint/Controllers/MaintainerTeamController.cs @@ -6,7 +6,7 @@ using WD7UVN_HFT_2023241.Models; namespace WD7UVN_HFT_2023241.Endpoint { [ApiController] - [Route("api/database")] + [Route("api/MaintainerTeam")] public class MaintainerTeamController : ControllerBase { public ILogicServices LogicServices { get; set; } diff --git a/WD7UVN_HFT_2023241.Endpoint/Controllers/ServiceController.cs b/WD7UVN_HFT_2023241.Endpoint/Controllers/ServiceController.cs index 1ed297a..43ea00b 100644 --- a/WD7UVN_HFT_2023241.Endpoint/Controllers/ServiceController.cs +++ b/WD7UVN_HFT_2023241.Endpoint/Controllers/ServiceController.cs @@ -6,7 +6,7 @@ using WD7UVN_HFT_2023241.Models; namespace WD7UVN_HFT_2023241.Endpoint { [ApiController] - [Route("api/database")] + [Route("api/Service")] public class ServiceController : ControllerBase { public ILogicServices LogicServices { get; set; }