File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff 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 */
2725const 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 }
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments