Skip to content
This repository has been archived by the owner on Jul 30, 2018. It is now read-only.

routes: update public routes #37

Merged
merged 1 commit into from
Jun 3, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# CHANGE LOG

## Unreleased
- [ ] Auth: add token refresh
- [ ] Register: add email validations
- [ ] Resources: add paginations
- [ ] Resources: index routes return `error not found` when needs to return `{ data: [] }`

### Add
- [x] Users.
Expand All @@ -14,3 +18,9 @@
- [ ] Register
- When register send an email confirmation.
- [ ] resources: add pagination.
- [x] Added public routes
- [x] GET /ongs
- [x] GET /ongs/:id
- [x] GET /campaigns
- [x] GET /campaigns/:id
- [x] POST /users
8 changes: 5 additions & 3 deletions app/Campaigns/routes.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
const Router = require('express').Router()
const { authorizeWithJwt } = require('../Authentication/middleware')

const controller = require('./controller')
const request = require('./request')

Router.get('/', controller.index)
Router.post('/', request, controller.store)
Router.get('/:id', controller.show)
Router.put('/:id', controller.save)
Router.delete('/:id', controller.remove)
Router.post('/', authorizeWithJwt, request, controller.store)
Router.put('/:id', authorizeWithJwt, controller.save)
Router.delete('/:id', authorizeWithJwt, controller.remove)

module.exports = Router
6 changes: 3 additions & 3 deletions app/Organizations/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ const request = require('./request')

Router.get('/', authorizeWithJwt, controller.index)
Router.get('/:id', controller.show)
Router.put('/:id', controller.save)
Router.post('/', request, controller.store)
Router.delete('/:id', controller.remove)
Router.put('/:id', authorizeWithJwt, controller.save)
Router.post('/', authorizeWithJwt, request, controller.store)
Router.delete('/:id', authorizeWithJwt, controller.remove)

module.exports = Router
7 changes: 3 additions & 4 deletions app/Users/routes.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
const Router = require('express').Router()
const { authorizeWithJwt } = require('../Authentication/middleware')

const users = require('./controller')
const request = require('./request')

Router.get('/', users.index)
Router.get('/:id', users.show)
Router.put('/:id', users.save)
Router.delete('/:id', users.remove)
Router.get('/:id', authorizeWithJwt, users.show)
Router.post('/', request, users.store)

module.exports = Router