in workshop-2/app/monolith-service/service/mysfitsTableClient.py [0:0]
def adoptMysfit(mysfitId):
# Use the DynamoDB API UpdateItem to set the value of the mysfit's
# Adopted attribute to True using an UpdateExpression.
response = client.update_item(
TableName=table_name,
Key={
'MysfitId': {
'S': mysfitId
}
},
UpdateExpression="SET Adopted = :b",
ExpressionAttributeValues={':b': {'BOOL': True}}
)
response = {}
response["Update"] = "Success";
return json.dumps(response)