Skip to content

Commit 515102d

Browse files
committed
jsdoc explaining use of undefined projectId
1 parent 89e6752 commit 515102d

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/lib/project-saver-hoc.jsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ import {
2121
* <ProjectSaverHOC>
2222
* <WrappedComponent />
2323
* </ProjectSaverHOC>
24-
*
25-
* storeProject(projectId): undefined value will cause POST/create; defined id will cause PUT/update
2624
*/
2725
const ProjectSaverHOC = function (WrappedComponent) {
2826
class ProjectSaverComponent extends React.Component {
@@ -49,6 +47,11 @@ const ProjectSaverHOC = function (WrappedComponent) {
4947
});
5048
}
5149
}
50+
/**
51+
* storeProject:
52+
* @param {number|string|undefined} projectId defined value causes PUT/update; undefined causes POST/create
53+
* @return {Promise} resolves with json object containing project's existing or new id
54+
*/
5255
storeProject (projectId) {
5356
return this.props.vm.saveProjectSb3()
5457
.then(content => {
@@ -62,7 +65,7 @@ const ProjectSaverHOC = function (WrappedComponent) {
6265
assetType,
6366
dataFormat,
6467
body,
65-
projectId // undefined value will cause POST/create; defined id will cause PUT/update
68+
projectId
6669
);
6770
});
6871
}

src/lib/vm-manager-hoc.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,10 @@ const vmManagerHOC = function (WrappedComponent) {
8383

8484
VMManager.propTypes = {
8585
isLoadingWithId: PropTypes.bool,
86+
loadingState: PropTypes.oneOf(LoadingStates),
8687
onLoadedProject: PropTypes.func,
8788
projectData: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
8889
projectId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
89-
loadingState: PropTypes.oneOf(LoadingStates),
9090
vm: PropTypes.instanceOf(VM).isRequired
9191
};
9292

0 commit comments

Comments
 (0)