schahriar/OpenFeedback

View on GitHub
api/SCRUD/methods/create.schema.js

Summary

Maintainability
A
1 hr
Test Coverage
module.exports = function (req, res) {
  req.schema.create(req.body, function (error, _id) {
    if (error) return res.json({ error: "Failed to create based on schema" });
    res.json({
      id: _id
    });
  });
};