diff --git a/routes/api/tracks.js b/routes/api/tracks.js index 12c5a1d..a967158 100644 --- a/routes/api/tracks.js +++ b/routes/api/tracks.js @@ -162,6 +162,11 @@ router.post( const trackData = new TrackData(); track.trackData = trackData._id; + if (req.body.track.body?.trim()) { + trackData.points = []; + addPointsToTrack({ trackData }, track.body); + } + track.author = user; track.visible = track.author.areTracksVisibleForAll; await trackData.save();