Compare commits

..

No commits in common. "eade0f6d694853dc3d49b7122201bf7ced22a195" and "e803adb387c1faa8a07d9bdd2adf8afa77746397" have entirely different histories.

View File

@ -36,11 +36,8 @@ namespace Api.DBAccess
}
_context.Users.Add(user);
bool saved = await _context.SaveChangesAsync() == 1;
if (saved) { return new OkObjectResult(true); }
return new ConflictObjectResult(new { message = "Could not save to databse" });
return new OkObjectResult(await _context.SaveChangesAsync());
}
public async Task<User> Login(Login login)
@ -111,7 +108,7 @@ namespace Api.DBAccess
}
}
_context.Users.Remove(user);
bool saved = await _context.SaveChangesAsync() >= 0;
bool saved = await _context.SaveChangesAsync() == 1;
if (saved) { return new OkObjectResult(saved); }