From ec728eb39299b8067365ef795c4e4be84802f414 Mon Sep 17 00:00:00 2001 From: catarak Date: Thu, 25 Aug 2016 11:25:22 -0400 Subject: [PATCH] fix uploading when project is saved --- client/modules/IDE/actions/files.js | 3 ++- client/modules/IDE/actions/uploader.js | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/client/modules/IDE/actions/files.js b/client/modules/IDE/actions/files.js index d9bb8e9f..cf09198b 100644 --- a/client/modules/IDE/actions/files.js +++ b/client/modules/IDE/actions/files.js @@ -71,7 +71,8 @@ export function createFile(formProps) { if (state.project.id) { const postParams = { name: createUniqueName(formProps.name, state.files), - url: formProps.url + url: formProps.url, + content: formProps.content || '' }; axios.post(`${ROOT_URL}/projects/${state.project.id}/files`, postParams, { withCredentials: true }) .then(response => { diff --git a/client/modules/IDE/actions/uploader.js b/client/modules/IDE/actions/uploader.js index ee305990..ad5e9c51 100644 --- a/client/modules/IDE/actions/uploader.js +++ b/client/modules/IDE/actions/uploader.js @@ -33,6 +33,7 @@ export function dropzoneAcceptCallback(file, done) { // for text files and small files // check mime type // if text, local interceptor + console.log(file.type); if (file.type.match(/text\//)) { localIntercept(file).then(result => { file.content = result; // eslint-disable-line