diff options
| author | ivarlovlie <git@ivarlovlie.no> | 2022-10-24 06:29:23 +0200 |
|---|---|---|
| committer | ivarlovlie <git@ivarlovlie.no> | 2022-10-24 06:29:23 +0200 |
| commit | 585c5c8537eb21dfc9f16108548e63d9ced3d971 (patch) | |
| tree | 1582bc45dcab585ec7204f1570019b2ca8de36c5 /code/api/src/Endpoints/V1/Entries/EntryQueryRoute.cs | |
| parent | 4b42c5235482fe0d3811b4e2936614c79e20d970 (diff) | |
| download | greatoffice-585c5c8537eb21dfc9f16108548e63d9ced3d971.tar.xz greatoffice-585c5c8537eb21dfc9f16108548e63d9ced3d971.zip | |
feat: Before move to FastEndpoints
Diffstat (limited to 'code/api/src/Endpoints/V1/Entries/EntryQueryRoute.cs')
| -rw-r--r-- | code/api/src/Endpoints/V1/Entries/EntryQueryRoute.cs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/code/api/src/Endpoints/V1/Entries/EntryQueryRoute.cs b/code/api/src/Endpoints/V1/Entries/EntryQueryRoute.cs index d431ac5..ec6003c 100644 --- a/code/api/src/Endpoints/V1/Entries/EntryQueryRoute.cs +++ b/code/api/src/Endpoints/V1/Entries/EntryQueryRoute.cs @@ -20,7 +20,7 @@ public class EntryQueryRoute : RouteBaseSync.WithRequest<EntryQueryPayload>.With [BasicAuthentication(AppConstants.TOKEN_ALLOW_READ)] [HttpPost("~/v{version:apiVersion}/entries/query")] [ProducesResponseType(204)] - [ProducesResponseType(400, Type = typeof(ErrorResult))] + [ProducesResponseType(400, Type = typeof(KnownProblemModel))] [ProducesResponseType(200, Type = typeof(EntryQueryResponse))] public override ActionResult<EntryQueryResponse> Handle(EntryQueryPayload entryQuery) { var result = new TimeQueryDto(); @@ -142,19 +142,19 @@ public class EntryQueryRoute : RouteBaseSync.WithRequest<EntryQueryPayload>.With break; case TimeEntryQueryDuration.DATE_RANGE: if (entryQuery.DateRange.From == default) { - return BadRequest(new ErrorResult("Invalid query", "From date cannot be empty")); + return BadRequest(new KnownProblemModel("Invalid query", "From date cannot be empty")); } var fromDate = DateTime.SpecifyKind(entryQuery.DateRange.From, DateTimeKind.Utc); if (entryQuery.DateRange.To == default) { - return BadRequest(new ErrorResult("Invalid query", "To date cannot be empty")); + return BadRequest(new KnownProblemModel("Invalid query", "To date cannot be empty")); } var toDate = DateTime.SpecifyKind(entryQuery.DateRange.To, DateTimeKind.Utc); if (DateTime.Compare(fromDate, toDate) > 0) { - return BadRequest(new ErrorResult("Invalid query", "To date cannot be less than From date")); + return BadRequest(new KnownProblemModel("Invalid query", "To date cannot be less than From date")); } var baseDateRangeEntries = baseQuery |
