Skip to content

Commit

Permalink
feat: Create User, InputAudio models
Browse files Browse the repository at this point in the history
See: #10
  • Loading branch information
sujinleeme committed Jun 30, 2018
1 parent 0e5ee6e commit 0ed92f7
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
23 changes: 23 additions & 0 deletions server/models/InputAudio.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
const mongoose = require('mongoose')

let InputAudioSchema = new mongoose.Schema(
{
text: String,
title: String,
author: {
type: mongoose.Schema.Types.ObjectId,
ref: 'User'
}
}
)

InputAudioSchema.methods.getUserRawAudioFile = (_id) => {
InputAudioSchema.find({'author': _id}).then((audio) => {
"use strict"
return audio
})
}

module.exports = mongoose.model('InputAudio', InputAudioSchema)


15 changes: 15 additions & 0 deletions server/models/User.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const mongoose = require('mongoose')

let UserSchema = new mongoose.Schema(
{
name: String,
email: String,
provider: String,
provider_id: String,
token: String,
provider_pic: String,

}
)

module.exports = mongoose.model('User', UserSchema)

0 comments on commit 0ed92f7

Please sign in to comment.