src/ > client/ and created assets/
This commit is contained in:
parent
b430d80c41
commit
2b0270c138
@ -1,7 +1,7 @@
|
||||
'use strict'
|
||||
|
||||
const defaults = {
|
||||
uri: 'mongodb://pomodoro-supreme:lets-work-our-asses-off-poop-poop@mongo.thecodebureau.com/pomodoro'
|
||||
uri: 'mongodb://pomodoro-supreme:lets-work-our-asses-off-poop-poop@mongo.bitmill.co/pomodoro'
|
||||
}
|
||||
|
||||
module.exports = Object.assign(defaults, {
|
||||
|
||||
@ -7,7 +7,11 @@ const formatQuery = require('warepot/format-query')
|
||||
const Pomodoro = require('./model')
|
||||
|
||||
function create(req, res, next) {
|
||||
Pomodoro.create(Object.assign(req.body, { user: req.user && req.user.id || '57b04f50a1eaaf354f3b96a6' }), (err, pomodoro) => {
|
||||
Pomodoro.create(Object.assign(req.body, {
|
||||
user: req.user && req.user.id || '57b04f50a1eaaf354f3b96a6',
|
||||
ip: req.ip,
|
||||
userAgent: req.headers['user-agent']
|
||||
}), (err, pomodoro) => {
|
||||
res.locals.pomodoro = pomodoro
|
||||
|
||||
next(err)
|
||||
|
||||
@ -17,7 +17,15 @@ const PomodoroSchema = new mongoose.Schema({
|
||||
type: mongoose.Schema.Types.ObjectId,
|
||||
ref: 'User',
|
||||
required: true
|
||||
}
|
||||
},
|
||||
ip: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
userAgent: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
})
|
||||
|
||||
module.exports = mongoose.model('Pomodoro', PomodoroSchema)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user