Skip to content

Commit

Permalink
idk, just the current state, project is ded
Browse files Browse the repository at this point in the history
  • Loading branch information
ForsakenHarmony committed May 22, 2017
1 parent ca8c0f0 commit 8813ccf
Show file tree
Hide file tree
Showing 11 changed files with 62 additions and 35 deletions.
Empty file added .babelrc
Empty file.
7 changes: 7 additions & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[ignore]

[include]

[libs]

[options]
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

3 changes: 3 additions & 0 deletions src/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/**
* Created by ForsakenHarmony on 19/03/17.
*/
17 changes: 17 additions & 0 deletions src/db/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const mongoose = require('mongoose');
mongoose.Promise = global.Promise;
const config = require.main.require('./config');

const models = require('./models');

mongoose.connect(config.mongoHost, 'chime');

module.exports = {
mongoose,
User : models.User,
Token : models.Token,
Comment : models.Comment,
Like : models.Like,
Notification: models.Notification,
Post : models.Post,
};
19 changes: 0 additions & 19 deletions src/db/model.js

This file was deleted.

3 changes: 3 additions & 0 deletions src/db/models/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/**
* Created by ForsakenHarmony on 19/03/17.
*/
26 changes: 26 additions & 0 deletions src/db/models/notification.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
const polymorphic = require('mongoose-polymorphic');

exports.init = (mongoose) => {
const Schema = mongoose.Schema;

const schema = new Schema({
user : { type: Schema.Types.ObjectId, ref: 'User', required: true },
notifier : { type: Schema.Types.ObjectId, ref: 'User', required: true },
type : { type: String, maxlength: 32, required: true },
created_at: { type: Date, default: Date.now },
updated_at: { type: Date, default: Date.now },
});

schema.plugin(polymorphic, {
associationKey: 'object',
promise : global.Promise,
required : true
});

schema.pre('save', function (next) {
this.updated_at = Date.now();
next();
});

return mongoose.model('Notifications', schema);
};
13 changes: 0 additions & 13 deletions src/db/mongo.js

This file was deleted.

3 changes: 3 additions & 0 deletions src/lib/authorize.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/**
* Created by ForsakenHarmony on 18/02/17.
*/
3 changes: 3 additions & 0 deletions src/lib/error.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/**
* Created by ForsakenHarmony on 20/02/17.
*/

0 comments on commit 8813ccf

Please sign in to comment.