clemsonMakerspace / unified-makerspace

The Makerspace - now unified.
Apache License 2.0
9 stars 11 forks source link

fix(cdk/visit/lambda_code): fix issue where register lambda does not #123

Closed DillonRanwala closed 1 year ago

DillonRanwala commented 1 year ago

update user registrations from website.

Problem: Certain users have been unable to submit their user registrations from the emailed link. When they click submit, the page does not refresh because the register user lambda fails. Therefore, their user data is not put into the databases. The problem stems from the lambda trying to set the "last_updated" attribute to an empty string ("") for non-test users. However, this is a Number attribute in DynamoDB and cannot be set to an empty string.

Solution: Changed the RegisterUser Lambda to avoid setting the "last_updated" attribute to an empty string. If the request json has that attribute (i.e. if it is a test request), it will set the attribute. Otherwise, the lambda will put the user info into DynamoDB without setting the "last_updated" attribute. This will allow both test and non-test registrations to pass without lambda errors.

Testing: The Dev lambda updated with this change did not raise any errors with test or non-test json requests. Also, the dev website had successful registrations that put items into the DynamoDB table without issues.

Issue: N/A, No open issue.