Skip to content
Snippets Groups Projects
Commit 81d513d0 authored by Vytor Calixto's avatar Vytor Calixto :space_invader:
Browse files

Add 'name' to simulation model

parent 714c1e40
No related branches found
No related tags found
1 merge request!116Release v1.0.0
Pipeline #
...@@ -15,6 +15,9 @@ let SimulationSchema = new Schema({ ...@@ -15,6 +15,9 @@ let SimulationSchema = new Schema({
content: { content: {
type: String, type: String,
required: true, required: true,
},
name: {
type: String
} }
}); });
......
...@@ -86,7 +86,8 @@ simulationApp.post('/', passport.authenticate('bearer', { session: false }), (re ...@@ -86,7 +86,8 @@ simulationApp.post('/', passport.authenticate('bearer', { session: false }), (re
let simulation = new Simulation({ let simulation = new Simulation({
userId: user._id, userId: user._id,
content: req.body.content content: req.body.content,
name: req.body.name
}); });
simulation.save((err) => { simulation.save((err) => {
...@@ -127,6 +128,7 @@ simulationApp.put('/:id', passport.authenticate('bearer', { session: false }), ( ...@@ -127,6 +128,7 @@ simulationApp.put('/:id', passport.authenticate('bearer', { session: false }), (
} }
simulation.content = req.body.content | simulation.content; simulation.content = req.body.content | simulation.content;
simulation.name = req.body.name | simulation.name;
simulation.save((err) => { simulation.save((err) => {
if(err) { if(err) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment