File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ public class Request : PagedRequestV1
15
15
{
16
16
public string ? Search { get ; set ; }
17
17
public Guid ? Id { get ; set ; }
18
-
18
+ public Guid ? clientId { get ; set ; }
19
19
public SortColumn SortBy { get ; set ; } = SortColumn . Name ;
20
20
public SortDirection SortDirection { get ; set ; } = SortDirection . Asc ;
21
21
}
Original file line number Diff line number Diff line change @@ -83,12 +83,15 @@ public ProjectServiceV1(HQDbContext context)
83
83
. OrderByDescending ( t => t . CreatedAt )
84
84
. AsQueryable ( ) ;
85
85
86
- var total = await records . CountAsync ( ct ) ;
86
+ if ( request . clientId . HasValue )
87
+ {
88
+ records = records . Where ( t => t . ClientId == request . clientId ) ;
89
+ }
87
90
88
91
if ( ! string . IsNullOrEmpty ( request . Search ) )
89
92
{
90
93
records = records . Where ( t =>
91
- t . Name . ToLower ( ) . Contains ( request . Search . ToLower ( ) ) ||
94
+ t . Name . ToLower ( ) . Contains ( request . Search . ToLower ( ) ) ||
92
95
t . Client . Name . ToLower ( ) . Contains ( request . Search . ToLower ( ) ) ||
93
96
( t . ChargeCode != null ? t . ChargeCode . Code . ToLower ( ) . Contains ( request . Search . ToLower ( ) ) : false )
94
97
) ;
@@ -140,6 +143,8 @@ public ProjectServiceV1(HQDbContext context)
140
143
{
141
144
mapped = mapped . Take ( request . Take . Value ) ;
142
145
}
146
+
147
+ var total = await records . CountAsync ( ct ) ;
143
148
144
149
var response = new GetProjectsV1 . Response ( )
145
150
{
You can’t perform that action at this time.
0 commit comments