|
@ -25,9 +25,9 @@ namespace CoviDok.Controllers |
|
|
|
|
|
|
|
|
// POST /api/Case/{id}
|
|
|
// POST /api/Case/{id}
|
|
|
[HttpPost("{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(); |
|
|
if (s == null) return Unauthorized(); |
|
|
|
|
|
|
|
|
try { |
|
|
try { |
|
@ -83,9 +83,9 @@ namespace CoviDok.Controllers |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
[HttpPost("{id}/updates")] |
|
|
[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(); |
|
|
if (s == null) return Unauthorized(); |
|
|
try { |
|
|
try { |
|
|
return await mgr.GetUpdatesForCase(s, id); |
|
|
return await mgr.GetUpdatesForCase(s, id); |
|
@ -101,9 +101,9 @@ namespace CoviDok.Controllers |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
[HttpPost("updates/{id}")] |
|
|
[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(); |
|
|
if (s == null) return Unauthorized(); |
|
|
try |
|
|
try |
|
|
{ |
|
|
{ |
|
@ -121,9 +121,9 @@ namespace CoviDok.Controllers |
|
|
|
|
|
|
|
|
// POST /api/Case/{id}/close
|
|
|
// POST /api/Case/{id}/close
|
|
|
[HttpPost("{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(); |
|
|
if (s == null) return Unauthorized(); |
|
|
try |
|
|
try |
|
|
{ |
|
|
{ |
|
@ -141,9 +141,9 @@ namespace CoviDok.Controllers |
|
|
} |
|
|
} |
|
|
// POST /api/Case/{id}/close
|
|
|
// POST /api/Case/{id}/close
|
|
|
[HttpPost("{id}/cure")] |
|
|
[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(); |
|
|
if (s == null) return Unauthorized(); |
|
|
try |
|
|
try |
|
|
{ |
|
|
{ |
|
|