After deploying my code to AWS Lambda, I noticed a strange issue. When I access the endpoint using Postman, it runs smoothly for the first time. However, upon subsequent attempts, I encounter the following error:
{
"error": "Validation error"
}
If I redeploy the code, it works once again before breaking. Interestingly, when running locally, this error never occurs.
The problem seems to be related to a specific line of code:
this._repo.save(user)
Although the model gets saved in the database without any issues, the error persists. Has anyone faced a similar issue before? What could possibly be causing this erratic behavior?
Here is the relevant code snippet:
public signUp(event: APIGatewayEvent): Observable<APIGatewayProxyResult> {
// Code implementation here...
}
private register(event: APIGatewayEvent): Observable<UserInfosModel> {
// Code implementation here...
}
Any insights or assistance on this matter would be greatly appreciated. Thank you!