Browse Source

Revert " Add Athlete model and correlation to trainer"

This reverts commit 4c5d5dd42c.
main
Haris Razis 4 years ago
parent
commit
a84938c8b2
  1. 1
      server/connections/mongo_conn.js
  2. 4
      server/index.js
  3. 10
      server/models/Athlete.js
  4. 2
      server/models/User.js

1
server/connections/mongo_conn.js

@ -3,7 +3,6 @@ const chalk = require('chalk')
const {mongo_uri} = require('../config/keys');
require('../models/User');
require('../models/Athlete');
mongoose.Promise = global.Promise;
mongoose.connect(mongo_uri, {

4
server/index.js

@ -6,12 +6,11 @@ const cors = require('cors')
const history = require('connect-history-api-fallback');
const rateLimit = require('express-rate-limit');
require('./connections/mongo_conn');
require('./services/socket')(server);
require('./connections/mongo_conn');
const dataRoute = require('./routes/data')
const authRoute = require('./routes/auth')
const athletesRoute = require('./routes/athletes')
const passport = require('./services/passport');
const {session_secret} = require('./config/keys');
@ -44,7 +43,6 @@ app.use(passport.session(undefined));
app.use(dataRoute)
app.use(authRoute)
app.use(athletesRoute)
app.use(history({
verbose: true

10
server/models/Athlete.js

@ -1,10 +0,0 @@
const mongoose = require('mongoose');
const {Schema} = mongoose;
const AthleteSchema = new Schema({
id: String,
name: String,
_trainer: {type: Schema.Types.ObjectId, ref: 'User'}
});
mongoose.model('Athlete', AthleteSchema);

2
server/models/User.js

@ -3,7 +3,7 @@ const {Schema} = mongoose;
const userSchema = new Schema({
username: String,
password: String,
password: String
});
mongoose.model('User', userSchema);
Loading…
Cancel
Save