fix uploading when project is saved

This commit is contained in:
catarak 2016-08-25 11:25:22 -04:00
parent a1dcf77557
commit ec728eb392
2 changed files with 3 additions and 1 deletions

View file

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

View file

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