MCPcopy
hub / github.com/diegohaz/rest / success

Function success

generators/app/templates/services/response/index.js:1–6  ·  view source on GitHub ↗
(res, status)

Source from the content-addressed store, hash-verified

1export const success = (res, status) => (entity) => {
2 if (entity) {
3 res.status(status || 200).json(entity)
4 }
5 return null
6}
7
8export const notFound = (res) => (entity) => {
9 if (entity) {

Callers 5

showFunction · 0.90
updateFunction · 0.90
loginFunction · 0.90
controller.jsFile · 0.90
controller.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected