Skip to content

Commit 5ab9df8

Browse files
refactor: search api
1 parent c6876e6 commit 5ab9df8

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/2-Clients/Api/Controllers/DemoThingsController.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using CanBeYours.Application.Dtos;
22
using CanBeYours.Application.Services.DemoThings;
3+
using CanBeYours.Core.Domain.DemoThings;
34
using CodeBlock.DevKit.Contracts.Dtos;
45
using CodeBlock.DevKit.Core.Helpers;
56
using CodeBlock.DevKit.Web.Api.Filters;
@@ -59,15 +60,21 @@ public async Task<Result<SearchOutputDto<GetDemoThingDto>>> Get(
5960
int pageNumber,
6061
int recordsPerPage,
6162
SortOrder sortOrder,
62-
[FromQuery] string term = null
63+
[FromQuery] string term = null,
64+
[FromQuery] DemoThingType? type = null,
65+
[FromQuery] DateTime? fromDateTime = null,
66+
[FromQuery] DateTime? toDateTime = null
6367
)
6468
{
6569
var dto = new SearchDemoThingsInputDto
6670
{
6771
Term = term,
6872
PageNumber = pageNumber,
6973
RecordsPerPage = recordsPerPage,
74+
FromDateTime = fromDateTime,
75+
ToDateTime = toDateTime,
7076
SortOrder = sortOrder,
77+
Type = type,
7178
};
7279
return await _demoThingService.SearchDemoThings(dto);
7380
}

0 commit comments

Comments
 (0)