revert project duplication to less broken state

This commit is contained in:
Cassie Tarakajian 2017-02-01 22:02:32 -05:00
parent 36a715fc3a
commit e7d0bb1112

View file

@ -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 => {