Skip to content

Commit

Permalink
#126 Accessibility - query metadata in booked records (controller)
Browse files Browse the repository at this point in the history
  • Loading branch information
kgniazdowski committed Nov 30, 2021
1 parent 69b0df9 commit 5a7d212
Showing 1 changed file with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using System;
using System.Collections.Generic;
using System.Net;
using System.Threading.Tasks;
using Accessibility.Api.BookedRecords;
using Accessibility.Application.BookedRecords.SetBookedRecordStatus;
using Accessibility.Application.Bookings.Queries.GetBookedRecordsOfFacility;
using Accessibility.Domain.Bookings.BookedRecords;
using Core.Queries;
using MediatR;
using Microsoft.AspNetCore.Mvc;

Expand Down Expand Up @@ -62,16 +62,13 @@ await mediator.Send(new SetBookedRecordStatusCommand(


[HttpGet("records")]
[ProducesResponseType(typeof(List<BookedRecordOfFacilityDto>), (int)HttpStatusCode.OK)]
public async Task<CollectionResponse<BookedRecordOfFacilityDto>> GetBookedRecords(
[ProducesResponseType(typeof(QueryCollectionResult<BookedRecordOfFacilityDto>), (int)HttpStatusCode.OK)]
public async Task<IActionResult> GetBookedRecords(
[FromRoute] Guid facilityId,
[FromQuery] DateTime dateFrom,
[FromQuery] DateTime dateTo
[FromQuery] GetBookedRecordsOfFacilityQueryParams @params
)
{
return new CollectionResponse<BookedRecordOfFacilityDto>(
await mediator.Send(new GetBookedRecordsOfFacilityQuery(facilityId, dateFrom, dateTo))
);
return Ok(await mediator.Send(new GetBookedRecordsOfFacilityQuery(facilityId, @params)));
}
}
}

0 comments on commit 5a7d212

Please sign in to comment.