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

Function if

generators/api/templates/model.js:5–11  ·  view source on GitHub ↗
(storeUser)

Source from the content-addressed store, hash-verified

3<%_ if (modelFields.length || storeUser) { _%>
4const <%= camel %>Schema = new Schema({
5 <%_ if (storeUser) { _%>
6 <%= userField %>: {
7 type: Schema.ObjectId,
8 ref: 'User',
9 required: true
10 }<%= modelFields.length ? ',' : '' %>
11 <%_ } _%>
12 <%_ modelFields.forEach(function (field, i) { _%>
13 <%= field %>: {
14 type: String

Callers 4

controller.jsFile · 0.70
index.jsFile · 0.70
model.test.jsFile · 0.70
index.test.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected