jambda
Version:
Easy serverless rest api deploy! Jambda makes it easy to deploy database connected rest api's by providing the least amount of configuration.
21 lines (17 loc) • 482 B
JavaScript
import { success } from '../helper/response'
import * as repository from '../lib/repository'
/**
* et one or all of the records
* If an id is present in the url it returns that entry
* If there is no id it returns all the entries
*
* @param {Schema} model The current model
* @returns {Function} An express-middleware
*/
const __new = model => {
const empty = repository.empty(model)
return (req, res) => {
success(200, empty(req.body), res)
}
}
export default __new