revert project duplication to less broken state
This commit is contained in:
parent
36a715fc3a
commit
e7d0bb1112
1 changed files with 7 additions and 6 deletions
|
@ -170,12 +170,13 @@ export function cloneProject() {
|
||||||
return (dispatch, getState) => {
|
return (dispatch, getState) => {
|
||||||
dispatch(setUnsavedChanges(false));
|
dispatch(setUnsavedChanges(false));
|
||||||
const state = getState();
|
const state = getState();
|
||||||
const newFiles = state.files.map(file => {
|
// const newFiles = state.files.map(file => {
|
||||||
const newFile = Object.assign({}, file);
|
// const newFile = Object.assign({}, file);
|
||||||
newFile._id = objectID().toHexString();
|
// newFile._id = objectID().toHexString();
|
||||||
newFile.id = newFile._id;
|
// newFile.id = newFile._id;
|
||||||
return newFile;
|
// return newFile;
|
||||||
});
|
// });
|
||||||
|
const newFiles = state.files;
|
||||||
const formParams = Object.assign({}, { name: `${state.project.name} copy` }, { files: newFiles });
|
const formParams = Object.assign({}, { name: `${state.project.name} copy` }, { files: newFiles });
|
||||||
axios.post(`${ROOT_URL}/projects`, formParams, { withCredentials: true })
|
axios.post(`${ROOT_URL}/projects`, formParams, { withCredentials: true })
|
||||||
.then(response => {
|
.then(response => {
|
||||||
|
|
Loading…
Reference in a new issue