From a84938c8b263d2d15f732de549abd7e7e548352a Mon Sep 17 00:00:00 2001 From: Haris Razis Date: Sat, 2 Jan 2021 15:08:10 +0200 Subject: [PATCH] =?UTF-8?q?Revert=20"=E2=9E=95=20Add=20Athlete=20model=20a?= =?UTF-8?q?nd=20correlation=20to=20trainer"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 4c5d5dd42c40944726748b15d9d8ebe79f19155b. --- server/connections/mongo_conn.js | 1 - server/index.js | 4 +--- server/models/Athlete.js | 10 ---------- server/models/User.js | 2 +- 4 files changed, 2 insertions(+), 15 deletions(-) delete mode 100644 server/models/Athlete.js diff --git a/server/connections/mongo_conn.js b/server/connections/mongo_conn.js index 9fe765f..1a4fb98 100644 --- a/server/connections/mongo_conn.js +++ b/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, { diff --git a/server/index.js b/server/index.js index 5db37cb..10ee245 100644 --- a/server/index.js +++ b/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 diff --git a/server/models/Athlete.js b/server/models/Athlete.js deleted file mode 100644 index 7aa1df9..0000000 --- a/server/models/Athlete.js +++ /dev/null @@ -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); diff --git a/server/models/User.js b/server/models/User.js index c2bef3b..83ed3d2 100644 --- a/server/models/User.js +++ b/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); \ No newline at end of file