@kaspernj/api-maker 1.0.122 → 1.0.123
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
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
]
|
|
17
17
|
},
|
|
18
18
|
"name": "@kaspernj/api-maker",
|
|
19
|
-
"version": "1.0.
|
|
19
|
+
"version": "1.0.123",
|
|
20
20
|
"description": "",
|
|
21
21
|
"main": "index.js",
|
|
22
22
|
"repository": {
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"@babel/preset-react": "^7.12.10",
|
|
49
49
|
"babel-jest": "^27.0.6",
|
|
50
50
|
"eslint": "^7.26.0",
|
|
51
|
-
"eslint-find-rules": "^
|
|
51
|
+
"eslint-find-rules": "^4.0.0",
|
|
52
52
|
"eslint-plugin-jest": "^24.3.6",
|
|
53
53
|
"eslint-plugin-react": "^7.23.2",
|
|
54
54
|
"i18n-on-steroids": "^1.0.2",
|
|
@@ -138,6 +138,7 @@ module.exports = class ApiMakerModelRecipesModelLoader {
|
|
|
138
138
|
})
|
|
139
139
|
} else if (type == "has_many") {
|
|
140
140
|
this.defineHasManyGetMethod({
|
|
141
|
+
activeRecordName,
|
|
141
142
|
className,
|
|
142
143
|
foreignKey,
|
|
143
144
|
ModelClass,
|
|
@@ -194,7 +195,7 @@ module.exports = class ApiMakerModelRecipesModelLoader {
|
|
|
194
195
|
}
|
|
195
196
|
}
|
|
196
197
|
|
|
197
|
-
defineHasManyGetMethod({className, foreignKey, ModelClass, modelMethodName, modelRecipesLoader, optionsAs, optionsThrough, relationshipName, resourceName}) {
|
|
198
|
+
defineHasManyGetMethod({activeRecordName, className, foreignKey, ModelClass, modelMethodName, modelRecipesLoader, optionsAs, optionsThrough, relationshipName, resourceName}) {
|
|
198
199
|
ModelClass.prototype[modelMethodName] = function () {
|
|
199
200
|
const id = this.primaryKey()
|
|
200
201
|
const modelClass = modelRecipesLoader.getModelClass(resourceName)
|
|
@@ -215,7 +216,7 @@ module.exports = class ApiMakerModelRecipesModelLoader {
|
|
|
215
216
|
queryParameters = {
|
|
216
217
|
params: {
|
|
217
218
|
through: {
|
|
218
|
-
model:
|
|
219
|
+
model: activeRecordName,
|
|
219
220
|
id: this.primaryKey(),
|
|
220
221
|
reflection: relationshipName
|
|
221
222
|
}
|