Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const markAsReadHandler = function (request, reply) {
const Conversation = mongoose.model('conversation');
const User = mongoose.model('user');
return RestHapi.addOne(Conversation, request.params._id, User, request.auth.credentials.user._id, 'userData', { hasRead: true })
.then(function (result) {
return reply(result)
})
.catch(function (error) {
Log.error(error);
return reply(RestHapi.errorHelper.formatResponse(error));
});
};