Closed jmeriksson closed 8 months ago
Introduction of new variable 'apiKey'
A new variable labelled 'apiKey' was created in the sendgrid.js
file to manage the SendGrid API key.
Assignment modification for 'apiKey' Changing the way we assign value to the 'apiKey'. Previously, it was done as a constant. Now, it is given value using the '=' operator which means it can change during the execution of the program.
Modification to 'try-catch' block
The try-catch
block in the code has been modified. Now, inside the 'try' portion, the new 'apiKey' variable is assigned its respective value.
Removal of 'catch' block
We removed the catch
block from the code. This usually handles errors, so we may have implemented a different error-handling method.
Dynamic value assignment to 'apiKey' The 'apiKey' now gets its value by executing a certain command and utilizing the result after trimming extra spaces at its ending. This enables a more dynamic and real-time usage of the SendGrid API key.
apiKey
variable before the try/catch statement so it is accessible before when trying to runclient.setApiKey(apiKey)
.