@@ -203,7 +203,6 @@ sub post_service_request {
203
203
204
204
$args -> {service_code_alloy }
205
205
= $self -> _munge_service_code( $args -> {service_code } );
206
-
207
206
my $rfs_design = $self -> config-> {rfs_design };
208
207
if (ref $rfs_design eq ' HASH' ) {
209
208
$rfs_design = $rfs_design -> {$args -> {service_code_alloy }} || $rfs_design -> {$self -> rfs_design_fallback};
@@ -388,37 +387,9 @@ sub _search_for_code_by_argument {
388
387
return undef ;
389
388
}
390
389
391
- my $body = $self -> find_item_body(
392
- dodi_code => $dodi_code ,
393
- attribute_code => $attribute_code ,
394
- search_term => $search_term ,
395
- );
396
-
397
- my $results = $self -> alloy-> search($body );
398
-
399
- return undef unless @$results ;
400
- my $result = $results -> [0];
401
-
402
- # Sanity check that our filtering to one result is the correct result
403
- my $a = $self -> alloy-> attributes_to_hash( $result );
404
- return undef unless $a -> {$attribute_code } && $a -> {$attribute_code } eq $search_term ;
405
- $result -> {attributes } = $a ;
406
-
407
- return $result ;
408
- }
409
-
410
- =head2 find_item_body
411
-
412
- Builds query body for looking up a specific item in Alloy.
413
-
414
- =cut
415
-
416
- sub find_item_body {
417
- my ( $self , %params ) = @_ ;
418
-
419
- return {
390
+ my $body = {
420
391
properties => {
421
- dodiCode => $params { dodi_code } ,
392
+ dodiCode => $dodi_code ,
422
393
collectionCode => " Live" ,
423
394
attributes => [ ' all' ],
424
395
},
@@ -429,19 +400,31 @@ sub find_item_body {
429
400
{
430
401
type => " Attribute" ,
431
402
properties => {
432
- attributeCode => $params { attribute_code } ,
403
+ attributeCode => $attribute_code ,
433
404
},
434
405
},
435
406
{
436
407
type => " String" ,
437
408
properties => {
438
- value => [ $params { search_term } ]
409
+ value => [ $search_term ]
439
410
}
440
411
}
441
412
]
442
413
}
443
414
]
444
415
};
416
+
417
+ my $results = $self -> alloy-> search($body );
418
+
419
+ return undef unless @$results ;
420
+ my $result = $results -> [0];
421
+
422
+ # Sanity check that our filtering to one result is the correct result
423
+ my $a = $self -> alloy-> attributes_to_hash( $result );
424
+ return undef unless $a -> {$attribute_code } && $a -> {$attribute_code } eq $search_term ;
425
+ $result -> {attributes } = $a ;
426
+
427
+ return $result ;
445
428
}
446
429
447
430
=head2 _create_contact
0 commit comments