diff --git a/.gitignore b/.gitignore
index 41b4a3d..a036818 100644
--- a/.gitignore
+++ b/.gitignore
@@ -106,5 +106,7 @@ dist
.idea/workspace.xml
.DS_Store
+
/dist
+
mongo_example_swarmlab.js
\ No newline at end of file
diff --git a/.idea/runConfigurations/dev_client.xml b/.idea/runConfigurations/dev_client.xml
deleted file mode 100644
index 128a3db..0000000
--- a/.idea/runConfigurations/dev_client.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/runConfigurations/dev_server.xml b/.idea/runConfigurations/dev_server.xml
deleted file mode 100644
index 178dee5..0000000
--- a/.idea/runConfigurations/dev_server.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/runConfigurations/run_client.xml b/.idea/runConfigurations/run_client.xml
deleted file mode 100644
index 16fb55f..0000000
--- a/.idea/runConfigurations/run_client.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/runConfigurations/run_server.xml b/.idea/runConfigurations/run_server.xml
deleted file mode 100644
index 80dccb1..0000000
--- a/.idea/runConfigurations/run_server.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/server/routes/athletes.js b/server/routes/athletes.js
index a390e31..af015cc 100644
--- a/server/routes/athletes.js
+++ b/server/routes/athletes.js
@@ -28,33 +28,19 @@ router.get('/api/athletes/:id/edit',
async (req, res) => {
const athlete = await Athlete.findById(req.params.id)
res.send(athlete)
- }
-)
-;
+ });
router.put('/api/athletes/:id',
requireAuth,
celebrate(athleteUpdateSchema, guid),
async (req, res) => {
const {name, _trainer} = req.body
- const updateAthlete = {name, _trainer}
-
- if (_trainer === '') {
- updateAthlete._trainer = undefined
- await Athlete.findByIdAndUpdate(req.params.id, updateAthlete, {}, (err, athlete) => {
- if (err)
- return res.status(400).json({errors: 'Something went wrong!'});
-
- return res.send(athlete)
- })
- } else if (name || _trainer)
- await Athlete.findByIdAndUpdate(req.params.id, updateAthlete, {}, (err, athlete) => {
- if (err)
- return res.status(400).json({errors: 'Something went wrong!'});
-
- res.send(athlete)
- })
+ await Athlete.findByIdAndUpdate(req.params.id, {name, _trainer}, {}, (err, athlete) => {
+ if (err)
+ return res.status(400).json({errors: 'Something went wrong!'});
+ res.send(athlete)
+ })
});
router.delete('/api/athlete/:id',
@@ -62,8 +48,6 @@ router.delete('/api/athlete/:id',
celebrate(guid),
async (req, res) => {
await Athlete.findByIdAndDelete(req.params.id)
- }
-)
-;
+ });
module.exports = router;
diff --git a/server/routes/user.js b/server/routes/user.js
index 32eded9..7332f3c 100644
--- a/server/routes/user.js
+++ b/server/routes/user.js
@@ -22,14 +22,12 @@ router.put('/api/user/:id',
if (isMatch) {
const user = {username, email, newPassword}
await User.findByIdAndUpdate(req.params.id, user)
-
res.send(req.user);
}
});
} else if (username || email) {
const user = {username, email}
await User.findByIdAndUpdate(req.params.id, user)
-
res.send(req.user);
}
diff --git a/web/babel.config.js b/web/babel.config.js
index e955840..c94e729 100644
--- a/web/babel.config.js
+++ b/web/babel.config.js
@@ -1,5 +1,5 @@
module.exports = {
- presets: [
- '@vue/cli-plugin-babel/preset'
- ]
+ presets: [
+ '@vue/cli-plugin-babel/preset'
+ ]
}
diff --git a/web/public/index.html b/web/public/index.html
index c46c86c..d35dd76 100644
--- a/web/public/index.html
+++ b/web/public/index.html
@@ -2,9 +2,9 @@
-
-
-
+
+
+
<%= htmlWebpackPlugin.options.title %>