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")]
|
||||
public class SwipeDataController : ApiController
|
||||
{
|
||||
//private SQLiteConnection _connection;
|
||||
private readonly IRepository _repo;
|
||||
public SwipeDataController(IRepository repo)
|
||||
{
|
||||
if(repo == null) throw new ArgumentNullException();
|
||||
_repo = repo;
|
||||
//_connection = conn;
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
@ -38,7 +36,6 @@ namespace WindowsDataCenter
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// //TODO: handle when more than one comes back. should NEVER happen but....
|
||||
// userId = cardIdQuery.First().UserId_FK;
|
||||
//}
|
||||
|
||||
@ -42,6 +42,7 @@ namespace WindowsDataCenter
|
||||
public IHttpActionResult CreateUser([FromBody] User user)
|
||||
{
|
||||
_repo.UpdateUser(user);
|
||||
//TODO return ID.
|
||||
return ResponseMessage(new HttpResponseMessage(HttpStatusCode.OK) {Content = new StringContent("unknownIdTODO")});
|
||||
}
|
||||
|
||||
@ -50,10 +51,11 @@ namespace WindowsDataCenter
|
||||
public IHttpActionResult EditUser([FromBody] User user)
|
||||
{
|
||||
_repo.UpdateUser(user);
|
||||
|
||||
//TODO: MUST HAVE - return user id!
|
||||
return
|
||||
ResponseMessage(new HttpResponseMessage(HttpStatusCode.Created)
|
||||
{
|
||||
//TODO: return ID
|
||||
Content = new StringContent("TODO:return UserID")
|
||||
});
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user