The always enthusiastic and knowledgeable mr. @jasaltvik shared with our team an article on writing (good) Git commit messages: How to Write a Git Commit Message. This excellent article explains why good Git commit messages are important, and explains what constitutes a good commit message. I wholeheartedly agree with what @cbeams writes in his article. (Have you read it yet? If not, go read it now. I'll wait.) It's sensible stuff. So I decided to start following the
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// I use passport as auth so req.user is set by it. | |
// Is this code feasible enough when the user has many farms with different crops, i.e when the user data grows | |
// As of now the code taken up to 1412 ms to complete | |
const { Farm } = require('../models/farm'); | |
getHistory = function(req, res, next) { | |
Farm.find().distinct('cropId', { userId: req.user._id }, (err, cropIds) => { | |
if (err) return res.send({ success: false, err }); | |
let i = 0; | |
let data = []; |