fix uploading when project is saved
This commit is contained in:
parent
a1dcf77557
commit
ec728eb392
2 changed files with 3 additions and 1 deletions
|
@ -71,7 +71,8 @@ export function createFile(formProps) {
|
||||||
if (state.project.id) {
|
if (state.project.id) {
|
||||||
const postParams = {
|
const postParams = {
|
||||||
name: createUniqueName(formProps.name, state.files),
|
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 })
|
axios.post(`${ROOT_URL}/projects/${state.project.id}/files`, postParams, { withCredentials: true })
|
||||||
.then(response => {
|
.then(response => {
|
||||||
|
|
|
@ -33,6 +33,7 @@ export function dropzoneAcceptCallback(file, done) {
|
||||||
// for text files and small files
|
// for text files and small files
|
||||||
// check mime type
|
// check mime type
|
||||||
// if text, local interceptor
|
// if text, local interceptor
|
||||||
|
console.log(file.type);
|
||||||
if (file.type.match(/text\//)) {
|
if (file.type.match(/text\//)) {
|
||||||
localIntercept(file).then(result => {
|
localIntercept(file).then(result => {
|
||||||
file.content = result; // eslint-disable-line
|
file.content = result; // eslint-disable-line
|
||||||
|
|
Loading…
Reference in a new issue