Skip to content

Commit 14aa454

Browse files
connorconnor
authored andcommitted
Fix deletetime endpoint.
1 parent dd95996 commit 14aa454

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

controllers.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ var { MongoClient, ObjectId } = require('mongodb')
22
var bcrypt = require('bcryptjs')
33
var salt = 10
44
// changed url to mongo for mongo docker container
5-
var MONGO_URL = process.env.MONGODB_URI || 'mongodb://mongo:27017/clock'
5+
var MONGO_URL = process.env.MONGODB_URI || 'mongodb+srv://connor:hB9qRiTQVgYNoJYy@clock-nerd-cluster.ldfnjft.mongodb.net/clocknerd?retryWrites=true&w=majority&appName=clock-nerd-cluster'
66
var client = null
77
var db = null
88
var users = null
@@ -141,8 +141,8 @@ module.exports.deletetime = async function(req, res) {
141141
{$pull: {times: {_id: new ObjectId(req.body.id)}}},
142142
{returnDocument: 'after'} // Return the updated document
143143
)
144-
if (result && result.value) {
145-
res.status(200).send({value: result.value})
144+
if (result) {
145+
res.status(200).send({value: result})
146146
} else {
147147
res.status(404).send("User not found")
148148
}

0 commit comments

Comments
 (0)