Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'use strict';
- var Report = require('./model.js');
- module.exports = {
- createReport: create,
- getReportById: getById
- };
- function create (report, cb) {
- var report = new Report(report);
- report.save(function (err, report) {
- if (err) {
- return cb(err);
- }
- cb(null, report);
- });
- }
- function getById (reportId, cb) {
- Report.findById({
- _id: reportId
- }, function (err, report) {
- if (err) {
- return cb(err);
- }
- cb(null, report);
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement