Skip to content
This repository was archived by the owner on Oct 29, 2019. It is now read-only.
This repository was archived by the owner on Oct 29, 2019. It is now read-only.

Update ClassYear.getCurrent() function and associated calls throughout app #796

@aeksco

Description

@aeksco

The ClassYear.getCurrent() uses a callback - it should return a "then-able" object so it can be used with async/await and Promises. See below:

// in classyear.model.js
ClassSchema.statics.getCurrent = function(cb){
  return ClassYear.findOne({ current: true })
};

Update all the locations this function is called in the application - do a find-all for ClassYear.getCurrent.

Also update the ClassYear.getCurrentCodes function to return a "then-able" as well.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions