Skip to content

Commit da7c256

Browse files
committed
Fix updateAgentJobStatus so it returns something other than true if e.g. the row is not found in the dynamodb table
1 parent 9d93a16 commit da7c256

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

template.yaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3905,7 +3905,16 @@ Resources:
39053905
}
39063906
}
39073907
ResponseMappingTemplate: |-
3908-
true
3908+
#if($ctx.error)
3909+
$util.error($ctx.error.message, $ctx.error.type)
3910+
#end
3911+
3912+
## Return false if no item was updated (item not found)
3913+
#if(!$ctx.result)
3914+
false
3915+
#else
3916+
true
3917+
#end
39093918
39103919
DeleteAgentJobResolver:
39113920
Type: AWS::AppSync::Resolver

0 commit comments

Comments
 (0)