rcos / observatory-server

A project tracking dashboard for Rensselaer Center for Open Source
https://rcos.io
MIT License
14 stars 51 forks source link

Improve Code Quality in attendance.controller.js #745

Closed aeksco closed 6 years ago

aeksco commented 6 years ago

Clean up tasks:

import { handleError } from '../lib/helpers'

this:

  ClassYear.find({}, function (err, model) {
    if (err) return handleError(err)
    ...
  })

becomes:

  ClassYear.find({})
  .then((model) => {
    ...
  })
  .catch((err) => {
    handleError(err)
  })