diff --git a/src/store/index.js b/src/store/index.js index ebe6a90..18d1a37 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -92,18 +92,7 @@ const store = new Vuex.Store({ commit('removeItem',item); }, async postItem({ commit, getters }, item) { - let blob = await fetch(item.dataImage).then(res => res.blob()); - 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? + const { data } = await axios.post(`/1/${getters.getEventSlug}/item`, item); commit('appendItem', data); } }