switch back to base64 images
This commit is contained in:
parent
2a69e231be
commit
79deed25bc
1 changed files with 1 additions and 12 deletions
|
@ -92,18 +92,7 @@ const store = new Vuex.Store({
|
||||||
commit('removeItem',item);
|
commit('removeItem',item);
|
||||||
},
|
},
|
||||||
async postItem({ commit, getters }, item) {
|
async postItem({ commit, getters }, item) {
|
||||||
let blob = await fetch(item.dataImage).then(res => res.blob());
|
const { data } = await axios.post(`/1/${getters.getEventSlug}/item`, item);
|
||||||
let file = new File([blob], 'dot.png', blob);
|
|
||||||
delete item.dataImage;
|
|
||||||
item.image = file;
|
|
||||||
var formData = new FormData();
|
|
||||||
for ( var key in item ) formData.append(key, item[key]);
|
|
||||||
const { data } = await axios.post(`/1/${getters.getEventSlug}/item`, formData, {
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'multipart/form-data'
|
|
||||||
}
|
|
||||||
});
|
|
||||||
console.log(data); // todo: maybe preprocess item data?
|
|
||||||
commit('appendItem', data);
|
commit('appendItem', data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue