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

Commit

Permalink
Add sending date on application
Browse files Browse the repository at this point in the history
  • Loading branch information
nbrohee committed Sep 19, 2016
1 parent 374f59a commit deb8cb7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion client/src/api/ApplicationApi.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import axios from 'axios'

axios.defaults.baseURL = 'http://localhost:3004/api'
axios.defaults.baseURL = 'https://etudiant-entrepreneur.herokuapp.com/api'

class ApplicationApi {

Expand Down
1 change: 1 addition & 0 deletions server/api/application/application.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ class ApplicationController {
return next(new StandardError('Tu a déjà soumis ta candidature', { code: 400 }))
}
req.body.status = 'sent'
req.body.sentDate = new Date()
return Application
.findByIdAndUpdate(req.params.id, req.body, { new: true })
.then((application) => {
Expand Down
3 changes: 2 additions & 1 deletion server/api/application/application.model.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ var ApplicationSchema = new Schema({
career: {},
pepite: {},
profile: {},
status: { type: String, default: 'saved' }
status: { type: String, default: 'saved' },
sentDate: { type: Date }
})

module.exports = mongoose.model('Application', ApplicationSchema)

0 comments on commit deb8cb7

Please sign in to comment.