switch back to base64 images

This commit is contained in:
j3d1 2019-12-27 01:26:40 +01:00
parent 2a69e231be
commit 79deed25bc

View file

@ -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);
} }
} }