@kaspernj/api-maker 1.0.299 → 1.0.300
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/with-model.jsx +6 -4
package/package.json
CHANGED
package/src/with-model.jsx
CHANGED
|
@@ -13,9 +13,11 @@ export default (WrappedComponent, modelClassArg, argsArg = {}) => {
|
|
|
13
13
|
|
|
14
14
|
modelClass = this.resolveModelClass(modelClassArg)
|
|
15
15
|
args = this.resolveArgs()
|
|
16
|
-
|
|
16
|
+
paramKey = this.modelClass.modelName().paramKey()
|
|
17
17
|
paramsVariableName = `${this.modelClass.modelName().paramKey()}_id`
|
|
18
18
|
|
|
19
|
+
nothing = console.error(this.modelClass.modelName())
|
|
20
|
+
|
|
19
21
|
state = {
|
|
20
22
|
model: undefined,
|
|
21
23
|
modelId: this.getModelId(),
|
|
@@ -115,9 +117,9 @@ export default (WrappedComponent, modelClassArg, argsArg = {}) => {
|
|
|
115
117
|
const {model, modelId, notFound} = digs(this.state, "model", "modelId", "notFound")
|
|
116
118
|
const wrappedComponentProps = {}
|
|
117
119
|
|
|
118
|
-
wrappedComponentProps[this.
|
|
119
|
-
wrappedComponentProps[`${this.
|
|
120
|
-
wrappedComponentProps[`${this.
|
|
120
|
+
wrappedComponentProps[this.paramKey] = model
|
|
121
|
+
wrappedComponentProps[`${this.paramKey}Id`] = modelId
|
|
122
|
+
wrappedComponentProps[`${this.paramKey}NotFound`] = notFound
|
|
121
123
|
|
|
122
124
|
return (
|
|
123
125
|
<>
|