Skip to content

Commit f73e6d6

Browse files
committed
publish button
1 parent 992353f commit f73e6d6

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

app/src/components/App.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export const App = (): JSX.Element => {
2626
if (window.localStorage.getItem('ssid') !== 'guest') {
2727
dispatch(toggleLoggedIn(true));
2828
}
29-
setToggleAttempt(!toggleAttempt);
29+
//setToggleAttempt(!toggleAttempt);
3030
}, []);
3131

3232
// following useEffect runs on first mount
@@ -61,7 +61,7 @@ export const App = (): JSX.Element => {
6161
}
6262
});
6363
}
64-
}, [toggleAttempt]);
64+
}, []);
6565
// useEffect(() => {
6666
// // provide config properties to legacy projects so new edits can be auto saved
6767
// // if (state.config === undefined) {

app/src/components/right/SaveProjectButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const dispatch = useDispatch();
3434
// If errors occur on the backend, the project name still gets updated
3535

3636
dispatch(updateProjectName(projectName))
37-
saveProject(projectName, state);
37+
saveProject(projectName, state).then((project) => {console.log(project)})
3838
setOpen(false);
3939
} else {
4040
setInvalidProjectName(true);

app/src/helperFunctions/projectGetSaveDel.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ export const saveProject = (
4848
})
4949
.then((res) => res.json())
5050
.then((data) => {
51-
return data.project;
51+
return {_id: data._id, ...data.project};
5252
})
5353
.catch((err) => console.log(`Error saving project ${err}`));
54-
return project;
54+
return project;//returns _id in addition to the project object from the document
5555
};
5656

5757
export const deleteProject = (project: any): Promise<Object> => {

server/controllers/marketplaceController.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ const marketplaceController: MarketplaceController = {
5252
}
5353
});
5454
}
55-
res.locals.publishedProject = result;
55+
res.locals.publishedProject = result; //returns the entire document
5656
return next();
5757
}
5858
);

0 commit comments

Comments
 (0)