Skip to content

Commit

Permalink
test: update snapshots to reflect sort key of single value
Browse files Browse the repository at this point in the history
  • Loading branch information
danielleadams authored and phani-srikar committed Jun 8, 2022
1 parent eafc412 commit eee67ed
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,12 @@ $util.qr($ctx.stash.put(\\"hasAuth\\", true))
#foreach( $entry in $primaryFieldMap.entrySet() )
#set( $modelQueryExpression.expression = \\"\${modelQueryExpression.expression} AND #\${entry.key} = :\${entry.key}\\" )
$util.qr($modelQueryExpression.expressionNames.put(\\"#\${entry.key}\\", $entry.key))
$util.qr($modelQueryExpression.expressionValues.put(\\":\${entry.key}\\", $util.dynamodb.toDynamoDB($entry.value)))
#if( $util.isList($entry.value) )
#set( $lastClaim = $entry.value.size() - 1 )
$util.qr($modelQueryExpression.expressionValues.put(\\":\${entry.key}\\", $util.dynamodb.toDynamoDB($entry.value[$lastClaim])))
#else
$util.qr($modelQueryExpression.expressionValues.put(\\":\${entry.key}\\", $util.dynamodb.toDynamoDB($entry.value)))
#end
#end
$util.qr($ctx.stash.put(\\"modelQueryExpression\\", $modelQueryExpression))
#set( $isAuthorized = true )
Expand Down Expand Up @@ -735,7 +740,12 @@ $util.qr($ctx.stash.put(\\"hasAuth\\", true))
#foreach( $entry in $primaryFieldMap.entrySet() )
#set( $modelQueryExpression.expression = \\"\${modelQueryExpression.expression} AND #\${entry.key} = :\${entry.key}\\" )
$util.qr($modelQueryExpression.expressionNames.put(\\"#\${entry.key}\\", $entry.key))
$util.qr($modelQueryExpression.expressionValues.put(\\":\${entry.key}\\", $util.dynamodb.toDynamoDB($entry.value)))
#if( $util.isList($entry.value) )
#set( $lastClaim = $entry.value.size() - 1 )
$util.qr($modelQueryExpression.expressionValues.put(\\":\${entry.key}\\", $util.dynamodb.toDynamoDB($entry.value[$lastClaim])))
#else
$util.qr($modelQueryExpression.expressionValues.put(\\":\${entry.key}\\", $util.dynamodb.toDynamoDB($entry.value)))
#end
#end
$util.qr($ctx.stash.put(\\"modelQueryExpression\\", $modelQueryExpression))
#set( $isAuthorized = true )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -834,17 +834,7 @@ describe("@model @primaryIndex @index auth", () => {
},
"expressionValues": Object {
":child": Object {
"L": Array [
Object {
"S": "${ownerRequest.jwt.sub}",
},
Object {
"S": "user1",
},
Object {
"S": "${ownerRequest.jwt.sub}::user1",
},
],
"S": "${ownerRequest.jwt.sub}::user1",
},
":parent": Object {
"S": "$ctx.args.parent",
Expand Down

0 comments on commit eee67ed

Please sign in to comment.