Skip to content

Commit

Permalink
Updated the dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
GauravWalia19 committed Oct 14, 2023
1 parent 71857be commit 7ae1504
Show file tree
Hide file tree
Showing 6 changed files with 590 additions and 1,214 deletions.
1 change: 0 additions & 1 deletion .github/job.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ const connectMongoDB = () => {
mongoose.connect(process.env.MONGODB_URI, {
useNewUrlParser: true,
useUnifiedTopology: true,
useCreateIndex: true,
})
const db = mongoose.connection
db.on('error', console.error.bind(console, 'Connection error:'))
Expand Down
26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,27 @@
"scripts": {
"start": "node ./bin/www.js",
"dev": "nodemon ./bin/www.js",
"test": "mocha --exit --timeout 15000",
"test": "mocha --exit --timeout 60000",
"build": "yarn install"
},
"author": "Gaurav Walia",
"license": "ISC",
"dependencies": {
"axios": "^0.21.1",
"axios": "^1.5.1",
"cors": "^2.8.5",
"express": "^4.17.1",
"express-rate-limit": "^5.3.0",
"mongoose": "^5.13.3",
"uuid": "^8.3.2"
"express": "^4.18.2",
"express-rate-limit": "^7.1.1",
"mongoose": "^7.6.2",
"uuid": "^9.0.1"
},
"devDependencies": {
"dotenv": "^10.0.0",
"husky": "^7.0.4",
"lint-staged": "^12.3.8",
"mocha": "^9.0.2",
"nodemon": "^2.0.12",
"prettier": "^2.6.2",
"supertest": "^6.1.3"
"dotenv": "^16.3.1",
"husky": "^8.0.3",
"lint-staged": "^14.0.1",
"mocha": "^10.2.0",
"nodemon": "^3.0.1",
"prettier": "^3.0.3",
"supertest": "^6.3.3"
},
"lint-staged": {
"*.js": "prettier --write"
Expand Down
1 change: 0 additions & 1 deletion routes/api/v1/API.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ router.put('/rateCode', authenticateAPI, updateValidator, async (req, res) => {
message: 'Bad Request!!!',
})
})

updateResult.status = 200
updateResult.message = 'Code Ratings are updated'
res.status(200).json(updateResult)
Expand Down
2 changes: 0 additions & 2 deletions src/engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ const {v4: uuidv4} = require('uuid')
mongoose.connect(process.env.MONGODB_URI, {
useNewUrlParser: true,
useUnifiedTopology: true,
useCreateIndex: true,
})
const db = mongoose.connection
db.on('error', console.error.bind(console, 'Connection error:'))
Expand Down Expand Up @@ -68,7 +67,6 @@ function callGithubApiToGetFileContent(url) {
* @return Promise
**/
function updateCodeBaseMongoDocument(codeId, codeRating) {
mongoose.set('useFindAndModify', false)
return codeRatingModel.findOneAndUpdate({codeId}, {codeRating}, {new: true})
}

Expand Down
3 changes: 2 additions & 1 deletion test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ describe('testing the code rating engine APIs', () => {
let codeId2 = ''
const SEARCH_USER = 'GauravWalia19'
beforeEach('get the random codes with token', async () => {
console.log('getting the token')
try {
const res = await request(app)
.get('/api/v1/randomCodes')
Expand All @@ -15,7 +16,7 @@ describe('testing the code rating engine APIs', () => {
codeId1 = res.body.codeObject1.codeId
codeId2 = res.body.codeObject2.codeId
} catch (err) {
console.log(err)
console.log('Error in getting random codes', err)
}
})

Expand Down
Loading

0 comments on commit 7ae1504

Please sign in to comment.