diff --git a/CoviDok/Controllers/CaseController.cs b/CoviDok/Controllers/CaseController.cs index 3cba6cc..a5485d2 100644 --- a/CoviDok/Controllers/CaseController.cs +++ b/CoviDok/Controllers/CaseController.cs @@ -25,9 +25,9 @@ namespace CoviDok.Controllers // POST /api/Case/{id} [HttpPost("{id}")] - public async Task<ActionResult<Case>> PostGetCase(int id, AuthGet auth) + public async Task<ActionResult<Case>> PostGetCase(int id, string SessionID) { - Session s = await Handler.GetSession(auth.SessionID); + Session s = await Handler.GetSession(SessionID); if (s == null) return Unauthorized(); try { @@ -83,9 +83,9 @@ namespace CoviDok.Controllers } [HttpPost("{id}/updates")] - public async Task<ActionResult<List<Update>>> GetUpdatesForCase(int id, AuthGet get) + public async Task<ActionResult<List<Update>>> GetUpdatesForCase(int id, string SessionID) { - Session s = await Handler.GetSession(get.SessionID); + Session s = await Handler.GetSession(SessionID); if (s == null) return Unauthorized(); try { return await mgr.GetUpdatesForCase(s, id); @@ -101,9 +101,9 @@ namespace CoviDok.Controllers } [HttpPost("updates/{id}")] - public async Task<ActionResult<Update>> GetUpdate(int id, AuthGet get) + public async Task<ActionResult<Update>> GetUpdate(int id, string SessionID) { - Session s = await Handler.GetSession(get.SessionID); + Session s = await Handler.GetSession(SessionID); if (s == null) return Unauthorized(); try { @@ -121,9 +121,9 @@ namespace CoviDok.Controllers // POST /api/Case/{id}/close [HttpPost("{id}/close")] - public async Task<IActionResult> PostClose(int id, CaseUpdate data) + public async Task<IActionResult> PostClose(int id, string SessionID) { - Session s = await Handler.GetSession(data.SessionID); + Session s = await Handler.GetSession(SessionID); if (s == null) return Unauthorized(); try { @@ -141,9 +141,9 @@ namespace CoviDok.Controllers } // POST /api/Case/{id}/close [HttpPost("{id}/cure")] - public async Task<IActionResult> PostCured(int id, CaseUpdate data) + public async Task<IActionResult> PostCured(int id, string SessionID) { - Session s = await Handler.GetSession(data.SessionID); + Session s = await Handler.GetSession(SessionID); if (s == null) return Unauthorized(); try { diff --git a/CoviDok/Controllers/ChildController.cs b/CoviDok/Controllers/ChildController.cs index 03ec51c..0f11189 100644 --- a/CoviDok/Controllers/ChildController.cs +++ b/CoviDok/Controllers/ChildController.cs @@ -23,9 +23,9 @@ namespace CoviDok.Controllers // POST: api/Child/5 [HttpPost("{id}")] - public async Task<ActionResult<PublicChild>> GetPublicChild(int id, AuthGet get) + public async Task<ActionResult<PublicChild>> GetPublicChild(int id, string SessionID) { - Session s = await Handler.GetSession(get.SessionID); + Session s = await Handler.GetSession(SessionID); if (s == null) return Unauthorized(); try @@ -67,9 +67,9 @@ namespace CoviDok.Controllers } [HttpPost("parent")] - public async Task<ActionResult<List<PublicChild>>> GetChildrenOfParent(AuthGet auth) + public async Task<ActionResult<List<PublicChild>>> GetChildrenOfParent(string SessionID) { - Session s = await Handler.GetSession(auth.SessionID); + Session s = await Handler.GetSession(SessionID); if (s == null) return Unauthorized(); return ChildManager.ChildrenOfParent(s.ID); } diff --git a/CoviDok/Controllers/DoctorController.cs b/CoviDok/Controllers/DoctorController.cs index fd499c3..5242614 100644 --- a/CoviDok/Controllers/DoctorController.cs +++ b/CoviDok/Controllers/DoctorController.cs @@ -97,9 +97,9 @@ namespace CoviDok.Controllers // GET /api/Doc/{id}/children [HttpPost("{id}/children")] - public async Task<ActionResult<ICollection<PublicChild>>> GetChildrenOfDoctor(int id, AuthGet get) + public async Task<ActionResult<ICollection<PublicChild>>> GetChildrenOfDoctor(int id, string SessionID) { - Session s = await Handler.GetSession(get.SessionID); + Session s = await Handler.GetSession(SessionID); if (s == null) return Unauthorized(); try { diff --git a/CoviDok/Controllers/ParentController.cs b/CoviDok/Controllers/ParentController.cs index 634c5a9..659d38c 100644 --- a/CoviDok/Controllers/ParentController.cs +++ b/CoviDok/Controllers/ParentController.cs @@ -22,9 +22,9 @@ namespace CoviDok.Controllers private readonly ParentManager parentManager = new ParentManager(); [HttpPost("{id}")] - public async Task<ActionResult<PublicParent>> GetParent(int id, AuthGet get) + public async Task<ActionResult<PublicParent>> GetParent(int id, string SessionID) { - Session s = await sessionHandler.GetSession(get.SessionID); + Session s = await sessionHandler.GetSession(SessionID); if (s == null) return Unauthorized(); try { return await parentManager.GetParent(id); @@ -58,9 +58,9 @@ namespace CoviDok.Controllers } } [HttpPost("{id}/children")] - public async Task<ActionResult<List<PublicChild>>> GetChildrenOfParent(int id, AuthGet get) + public async Task<ActionResult<List<PublicChild>>> GetChildrenOfParent(int id, string SessionID) { - Session s = await sessionHandler.GetSession(get.SessionID); + Session s = await sessionHandler.GetSession(SessionID); if (s == null) return Unauthorized(); try { diff --git a/CoviDok/api/Request/AuthGet.cs b/CoviDok/api/Request/AuthGet.cs deleted file mode 100644 index f6e6817..0000000 --- a/CoviDok/api/Request/AuthGet.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace CoviDok.Api.Request -{ - public class AuthGet - { - public string SessionID { get; set; } - } -}