aboutsummaryrefslogtreecommitdiff
path: root/API/Controllers/UserController.cs
diff options
context:
space:
mode:
authortranstrike <transtrike@gmail.com>2020-12-10 14:15:38 +0200
committertranstrike <transtrike@gmail.com>2020-12-10 14:15:38 +0200
commit6a662373c8300f108ceedaa32b5a076352cb4da6 (patch)
tree7adc70ab5829fea4f869906591aa32e4cf55666f /API/Controllers/UserController.cs
parentee80c6ff969b5b4cfc3d1292f15928fc8bd2d667 (diff)
downloadDevHive-6a662373c8300f108ceedaa32b5a076352cb4da6.tar
DevHive-6a662373c8300f108ceedaa32b5a076352cb4da6.tar.gz
DevHive-6a662373c8300f108ceedaa32b5a076352cb4da6.zip
Implemented all HTTP Methods
Diffstat (limited to 'API/Controllers/UserController.cs')
-rw-r--r--API/Controllers/UserController.cs14
1 files changed, 8 insertions, 6 deletions
diff --git a/API/Controllers/UserController.cs b/API/Controllers/UserController.cs
index c2d6f2c..22555c6 100644
--- a/API/Controllers/UserController.cs
+++ b/API/Controllers/UserController.cs
@@ -24,14 +24,12 @@ namespace API.Controllers
[HttpPost]
public async Task<HttpStatusCode> Create([FromBody] UserDTO userDTO)
{
- HttpStatusCode returnStatusCode = await this._service.CreateUser(userDTO);
-
- return returnStatusCode;
+ return await this._service.CreateUser(userDTO);
}
//Read
[HttpGet]
- public async Task<string> GetById(int id)
+ public async Task<string> GetById(int id)
{
return await this._service.GetUserById(id);
}
@@ -43,7 +41,11 @@ namespace API.Controllers
return await this._service.UpdateUser(id, userDTO);
}
- // //Delete
- // [HttpDelete]
+ //Delete
+ [HttpDelete]
+ public async Task<HttpStatusCode> Delete(int id)
+ {
+ return await this._service.DeleteUser(id);
+ }
}
}