Skip to content

Commit

Permalink
addevent function
Browse files Browse the repository at this point in the history
  • Loading branch information
razan99 committed Jun 19, 2018
1 parent 7a4da75 commit 574a83f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/database/db_build.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const { db, mongoose } = require('./db_connect');
const AddEvent=mongoose.model('event,eventSchema')

db.on('error', console.error.bind(console, 'connection error'))
db.on('error', console.error.bind(console, 'connection error');
.once('open', () => {
console.log('we\'re live');
});
Expand All @@ -16,7 +17,7 @@ const usersSchema = new Schema({
email: { type: String, unique: true },
});

const NinjaSchema = new Schema({
const AddEventSchema = new Schema({
startDate: Date,
endDate: Date,
title: String,
Expand Down
1 change: 0 additions & 1 deletion src/views/addEvent.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ function myFunction() {
}
</script>


</form>

</div>

1 comment on commit 574a83f

@FarahZaqout
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mongoose.model is used to define a new collection. You add a new event by creating a new instance of the events table check out the test file for the details of it.

Please sign in to comment.