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

Commit

Permalink
Merge pull request #37 from arrecadar/add/public-routes
Browse files Browse the repository at this point in the history
  • Loading branch information
hiwllc authored Jun 3, 2018
2 parents a1715d6 + ae3f819 commit 85dffa9
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 10 deletions.
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

0 comments on commit 85dffa9

Please sign in to comment.