Moved CardsController, SwipeDataController, UsersController, ValuesController to a "Controllers" dir.
This commit is contained in:
parent
4ac6b2475b
commit
532bf2b105
@ -9,13 +9,11 @@ namespace WindowsDataCenter
|
|||||||
[RoutePrefix("api/swipedata")]
|
[RoutePrefix("api/swipedata")]
|
||||||
public class SwipeDataController : ApiController
|
public class SwipeDataController : ApiController
|
||||||
{
|
{
|
||||||
//private SQLiteConnection _connection;
|
|
||||||
private readonly IRepository _repo;
|
private readonly IRepository _repo;
|
||||||
public SwipeDataController(IRepository repo)
|
public SwipeDataController(IRepository repo)
|
||||||
{
|
{
|
||||||
if(repo == null) throw new ArgumentNullException();
|
if(repo == null) throw new ArgumentNullException();
|
||||||
_repo = repo;
|
_repo = repo;
|
||||||
//_connection = conn;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
@ -38,7 +36,6 @@ namespace WindowsDataCenter
|
|||||||
//}
|
//}
|
||||||
//else
|
//else
|
||||||
//{
|
//{
|
||||||
// //TODO: handle when more than one comes back. should NEVER happen but....
|
|
||||||
// userId = cardIdQuery.First().UserId_FK;
|
// userId = cardIdQuery.First().UserId_FK;
|
||||||
//}
|
//}
|
||||||
|
|
||||||
@ -42,6 +42,7 @@ namespace WindowsDataCenter
|
|||||||
public IHttpActionResult CreateUser([FromBody] User user)
|
public IHttpActionResult CreateUser([FromBody] User user)
|
||||||
{
|
{
|
||||||
_repo.UpdateUser(user);
|
_repo.UpdateUser(user);
|
||||||
|
//TODO return ID.
|
||||||
return ResponseMessage(new HttpResponseMessage(HttpStatusCode.OK) {Content = new StringContent("unknownIdTODO")});
|
return ResponseMessage(new HttpResponseMessage(HttpStatusCode.OK) {Content = new StringContent("unknownIdTODO")});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -50,10 +51,11 @@ namespace WindowsDataCenter
|
|||||||
public IHttpActionResult EditUser([FromBody] User user)
|
public IHttpActionResult EditUser([FromBody] User user)
|
||||||
{
|
{
|
||||||
_repo.UpdateUser(user);
|
_repo.UpdateUser(user);
|
||||||
|
//TODO: MUST HAVE - return user id!
|
||||||
return
|
return
|
||||||
ResponseMessage(new HttpResponseMessage(HttpStatusCode.Created)
|
ResponseMessage(new HttpResponseMessage(HttpStatusCode.Created)
|
||||||
{
|
{
|
||||||
|
//TODO: return ID
|
||||||
Content = new StringContent("TODO:return UserID")
|
Content = new StringContent("TODO:return UserID")
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user