Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Website API / Backend #20

Open
1 of 3 tasks
renatomcamilio opened this issue May 16, 2017 · 6 comments
Open
1 of 3 tasks

Website API / Backend #20

renatomcamilio opened this issue May 16, 2017 · 6 comments
Assignees
Milestone

Comments

@renatomcamilio
Copy link
Contributor

renatomcamilio commented May 16, 2017

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
  • integrate with volunteer manager software to list projects, contributors, etc.
  • page editor: will be used to edit guides, like the ones we have on the org wiki
@renatomcamilio renatomcamilio added this to the website v2 milestone May 16, 2017
@stephen-slm stephen-slm self-assigned this May 16, 2017
@stephen-slm
Copy link
Contributor

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.

@renatomcamilio
Copy link
Contributor Author

renatomcamilio commented May 16, 2017

Thanks for the update, this one (regarding the volunteer software integration) is definitely on hold. We can even break into its own task.

@stephen-slm
Copy link
Contributor

stephen-slm commented May 16, 2017

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? **/ }
}

@renatomcamilio
Copy link
Contributor Author

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.

@stephen-slm
Copy link
Contributor

Update:

Core base in ready for the start of UI works, test framework will begin tomorrow.

@stephen-slm
Copy link
Contributor

Update: Will be away from the 23rd to the 11th of Aug as i'm out the country.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants