studiokit-scaffolding-js 7.0.5-alpha.2 → 7.0.5-alpha.2.2
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/lib/utils/collection.js +15 -1
- package/package.json +1 -1
package/lib/utils/collection.js
CHANGED
|
@@ -160,7 +160,21 @@ function createCollectionItem(model, config, params) {
|
|
|
160
160
|
if (model.id) {
|
|
161
161
|
throw new Error('model already exists');
|
|
162
162
|
}
|
|
163
|
-
|
|
163
|
+
var guid = config.guid, modelName = config.modelName, pathParams = config.pathParams, configQueryParams = config.queryParams, changeModelStatus = config.changeModelStatus;
|
|
164
|
+
var body = params.body, contentType = params.contentType, queryParams = params.queryParams;
|
|
165
|
+
if (pathParams && pathParams.length < route_1.getMinRequiredPathParamsCount(modelName)) {
|
|
166
|
+
throw new Error('pathParams length does not match length of path components');
|
|
167
|
+
}
|
|
168
|
+
changeModelStatus(constants_1.MODEL_STATUS.CREATING);
|
|
169
|
+
actionCreator_1.dispatchModelFetchRequest({
|
|
170
|
+
modelName: modelName,
|
|
171
|
+
guid: guid,
|
|
172
|
+
method: 'POST',
|
|
173
|
+
body: body,
|
|
174
|
+
pathParams: pathParams,
|
|
175
|
+
contentType: contentType,
|
|
176
|
+
queryParams: queryParams || configQueryParams
|
|
177
|
+
});
|
|
164
178
|
}
|
|
165
179
|
exports.createCollectionItem = createCollectionItem;
|
|
166
180
|
//#endregion Create
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "studiokit-scaffolding-js",
|
|
3
|
-
"version": "7.0.5-alpha.2",
|
|
3
|
+
"version": "7.0.5-alpha.2.2",
|
|
4
4
|
"description": "Common scaffolding for Studio apps at Purdue",
|
|
5
5
|
"repository": "https://gitlab.com/purdue-informatics/studiokit/studiokit-scaffolding-js",
|
|
6
6
|
"license": "MIT",
|