aboutsummaryrefslogtreecommitdiffstats
path: root/code/api/src/Endpoints/V1/Entries/UpdateEntryRoute.cs
diff options
context:
space:
mode:
authorivarlovlie <git@ivarlovlie.no>2022-10-24 06:29:23 +0200
committerivarlovlie <git@ivarlovlie.no>2022-10-24 06:29:23 +0200
commit585c5c8537eb21dfc9f16108548e63d9ced3d971 (patch)
tree1582bc45dcab585ec7204f1570019b2ca8de36c5 /code/api/src/Endpoints/V1/Entries/UpdateEntryRoute.cs
parent4b42c5235482fe0d3811b4e2936614c79e20d970 (diff)
downloadgreatoffice-585c5c8537eb21dfc9f16108548e63d9ced3d971.tar.xz
greatoffice-585c5c8537eb21dfc9f16108548e63d9ced3d971.zip
feat: Before move to FastEndpoints
Diffstat (limited to 'code/api/src/Endpoints/V1/Entries/UpdateEntryRoute.cs')
-rw-r--r--code/api/src/Endpoints/V1/Entries/UpdateEntryRoute.cs4
1 files changed, 2 insertions, 2 deletions
diff --git a/code/api/src/Endpoints/V1/Entries/UpdateEntryRoute.cs b/code/api/src/Endpoints/V1/Entries/UpdateEntryRoute.cs
index ac233e0..09e3b9c 100644
--- a/code/api/src/Endpoints/V1/Entries/UpdateEntryRoute.cs
+++ b/code/api/src/Endpoints/V1/Entries/UpdateEntryRoute.cs
@@ -16,7 +16,7 @@ public class UpdateEntryRoute : RouteBaseSync.WithRequest<TimeEntry.TimeEntryDto
[ApiVersion(ApiSpecV1.VERSION_STRING)]
[BasicAuthentication(AppConstants.TOKEN_ALLOW_UPDATE)]
[HttpPost("~/v{version:apiVersion}/entries/update")]
- [ProducesResponseType(404, Type = typeof(ErrorResult))]
+ [ProducesResponseType(404, Type = typeof(KnownProblemModel))]
[ProducesResponseType(200, Type = typeof(TimeEntry.TimeEntryDto))]
public override ActionResult<TimeEntry.TimeEntryDto> Handle(TimeEntry.TimeEntryDto timeEntryTimeEntryDto) {
var entry = _context.TimeEntries
@@ -32,7 +32,7 @@ public class UpdateEntryRoute : RouteBaseSync.WithRequest<TimeEntry.TimeEntryDto
.Where(c => c.UserId == LoggedInUser.Id)
.SingleOrDefault(c => c.Id == timeEntryTimeEntryDto.Category.Id);
if (category == default) {
- return NotFound(new ErrorResult("Not found", $"Could not find category {timeEntryTimeEntryDto.Category.Name}"));
+ return NotFound(new KnownProblemModel("Not found", $"Could not find category {timeEntryTimeEntryDto.Category.Name}"));
}
entry.Start = timeEntryTimeEntryDto.Start.ToUniversalTime();