/TuneS-server

Back-End for Music Search and Social Website

Primary LanguageJavaScript

TuneS

npm start dev dev configured with local mongodb prod configured with heroku env mongodb mongodb local: mongod --port 12345

verify schema for: update, create

1.user not in session- error 2.user in session but not in database --error, so may cause "follow" bugs, but not possible in most cases 3. user in session and in database --if transction, OK

validated that user id and subject id are strings. find by string for onjectId is OK, object is will go to frontend string but set string as objectId in ref is not OK, need ObjectId(string) to convert

saveUser in user.dao.js changed to transactional database access, han's previous change is not transactional, thus may lead to unexpected database change = (user, callback) => { return userModel.collection.update({sid: payload.profile.id}, { $setOnInsert: user }, { upsert: true }, (err, res)=>{ if(err){return}; callback() })

in comment.dao.js, change create to save, create may lead to error since that createComment function is not transcational change some other create to save for same reasons

in comment.dao.js, han's deleteComment and updatecomment are changed, since we must verify that commentId belongs to user in this session, frontend information is not ok for verification