Open renatomcamilio opened 7 years ago
Estimate: Unavailable
I cannot really set a estimate due a core part is based on when the volunteer software database is accessible to pull the data from.
Thanks for the update, this one (regarding the volunteer software integration) is definitely on hold. We can even break into its own task.
if (_.isNil(sender.name) || _.isNil(sender.email) || _.isNil(sender.text)) {
// TODO: Find out what our frontend is expecting in formatted response
return res.status(400).send('Invalid format')
}
When we reject or return the clients request what is the format that will be sent back? What do we feel should be the response format? (for replacing 'Invalid format')
for example:
{
message: 'Response message'
content: { /** A object containing any content requested? **/ }
}
So for error responses, we would set the status just like you've done, 400
for a client error, and send a payload like this:
{
error: 'Invalid format',
description: 'Please, make sure you\'ve filled all of the required fields'
}
The idea is to follow a convention that the frontend can handle smoothly -- giving enough context to our users without having to write specific logic around that.
For successful response, we can follow REST patterns. e.g. for the contact form submission (POST), you would return status 200
basically, no need to send nothing in the payload.
Update:
Core base in ready for the start of UI works, test framework will begin tomorrow.
Update: Will be away from the 23rd to the 11th of Aug as i'm out the country.
This task will be updated with more details as we figure out what might be needed; So far, work to be done on the backend:
POST /contact-us
endpoint to receive contact information from frontend