aboutsummaryrefslogtreecommitdiffstats
path: root/code/api/src/Endpoints/Internal/Account
diff options
context:
space:
mode:
Diffstat (limited to 'code/api/src/Endpoints/Internal/Account')
-rw-r--r--code/api/src/Endpoints/Internal/Account/GetAccountRoute.cs4
-rw-r--r--code/api/src/Endpoints/Internal/Account/UpdateAccountRoute.cs4
2 files changed, 4 insertions, 4 deletions
diff --git a/code/api/src/Endpoints/Internal/Account/GetAccountRoute.cs b/code/api/src/Endpoints/Internal/Account/GetAccountRoute.cs
index 121b40f..67c4d4d 100644
--- a/code/api/src/Endpoints/Internal/Account/GetAccountRoute.cs
+++ b/code/api/src/Endpoints/Internal/Account/GetAccountRoute.cs
@@ -12,7 +12,7 @@ public class GetAccountRoute : RouteBaseAsync.WithoutRequest.WithActionResult<Lo
public override async Task<ActionResult<LoggedInUserModel>> HandleAsync(CancellationToken cancellationToken = default) {
var user = _database.Users
.Select(x => new {x.Username, x.Id})
- .SingleOrDefault(c => c.Id == LoggedInUser.Id);
+ .FirstOrDefault(c => c.Id == LoggedInUser.Id);
if (user != default) {
return Ok(new LoggedInUserModel {
Id = LoggedInUser.Id,
@@ -23,4 +23,4 @@ public class GetAccountRoute : RouteBaseAsync.WithoutRequest.WithActionResult<Lo
await HttpContext.SignOutAsync();
return Unauthorized();
}
-} \ No newline at end of file
+}
diff --git a/code/api/src/Endpoints/Internal/Account/UpdateAccountRoute.cs b/code/api/src/Endpoints/Internal/Account/UpdateAccountRoute.cs
index 1081240..f6e18af 100644
--- a/code/api/src/Endpoints/Internal/Account/UpdateAccountRoute.cs
+++ b/code/api/src/Endpoints/Internal/Account/UpdateAccountRoute.cs
@@ -19,7 +19,7 @@ public class UpdateAccountRoute : RouteBaseAsync.WithRequest<UpdateAccountRoute.
[HttpPost("~/_/account/update")]
public override async Task<ActionResult> HandleAsync(Payload request, CancellationToken cancellationToken = default) {
- var user = _database.Users.SingleOrDefault(c => c.Id == LoggedInUser.Id);
+ var user = _database.Users.FirstOrDefault(c => c.Id == LoggedInUser.Id);
if (user == default) {
await HttpContext.SignOutAsync();
return Unauthorized();
@@ -56,4 +56,4 @@ public class UpdateAccountRoute : RouteBaseAsync.WithRequest<UpdateAccountRoute.
await _database.SaveChangesAsync(cancellationToken);
return Ok();
}
-} \ No newline at end of file
+}