@@ -20,7 +20,12 @@ export class AgntcyController {
2020 // Validators
2121 public static recordPublishValidator = [
2222 check ( 'data' ) . exists ( ) . withMessage ( 'data field is required' ) . bail ( ) ,
23- check ( 'data.name' ) . exists ( ) . withMessage ( 'name is required' ) . isString ( ) . withMessage ( 'name must be a string' ) . bail ( ) ,
23+ check ( 'data.name' )
24+ . exists ( )
25+ . withMessage ( 'name is required' )
26+ . isString ( )
27+ . withMessage ( 'name must be a string' )
28+ . bail ( ) ,
2429 check ( 'data.version' )
2530 . exists ( )
2631 . withMessage ( 'version is required' )
@@ -62,11 +67,7 @@ export class AgntcyController {
6267 . withMessage ( 'Invalid record type' )
6368 . bail ( ) ,
6469 query ( 'page' ) . optional ( ) . isInt ( { min : 1 } ) . withMessage ( 'page must be a positive integer' ) . bail ( ) ,
65- query ( 'limit' )
66- . optional ( )
67- . isInt ( { min : 1 , max : 100 } )
68- . withMessage ( 'limit must be between 1 and 100' )
69- . bail ( ) ,
70+ query ( 'limit' ) . optional ( ) . isInt ( { min : 1 , max : 100 } ) . withMessage ( 'limit must be between 1 and 100' ) . bail ( ) ,
7071 ] ;
7172
7273 public static recordGetValidator = [
@@ -263,12 +264,10 @@ export class AgntcyController {
263264
264265 try {
265266 // Set defaults for pagination
266- const { page = 1 , limit = 20 } = request . query as SearchRecordQuery ;
267+ const { page = 1 , limit = 20 } = request . query as SearchRecordQuery ;
267268
268269 // Search directory
269- const results = await agntcyService . search (
270- response . locals . customer ,
271- {
270+ const results = await agntcyService . search ( response . locals . customer , {
272271 ...query ,
273272 page,
274273 limit,
@@ -284,7 +283,6 @@ export class AgntcyController {
284283 total : results . total ,
285284 total_pages : Math . ceil ( results . total / limit ) ,
286285 } ,
287- filters_applied : this . getAppliedFilters ( query ) ,
288286 } satisfies SearchRecordResponseBody ) ;
289287 } catch ( error ) {
290288 return response . status ( StatusCodes . INTERNAL_SERVER_ERROR ) . json ( {
@@ -406,4 +404,4 @@ export class AgntcyController {
406404
407405 return filters ;
408406 }
409- }
407+ }
0 commit comments