From 388b243955628e710f7dcc7c60ab4759e50f9134 Mon Sep 17 00:00:00 2001 From: busti Date: Sat, 14 Dec 2019 23:51:06 +0100 Subject: [PATCH] properly implement editing items --- .eslintrc.js | 2 +- src/components/EditItem.vue | 7 ++----- src/store/index.js | 5 +++++ src/views/Items.vue | 15 ++++++++++----- 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index b03b412..c2931c7 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -21,7 +21,7 @@ module.exports = { 2 ], 'linebreak-style': [ - 'error', + 'off', 'unix' ], 'quotes': [ diff --git a/src/components/EditItem.vue b/src/components/EditItem.vue index 61f0471..559b458 100644 --- a/src/components/EditItem.vue +++ b/src/components/EditItem.vue @@ -3,7 +3,7 @@
Editing Item #{{ item[badge] }}
-
+
@@ -14,9 +14,6 @@ - - \ No newline at end of file diff --git a/src/store/index.js b/src/store/index.js index c40c35c..af4ac76 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -67,6 +67,11 @@ const store = new Vuex.Store({ commit('replaceBoxes', resp.data); }, + async updateItem({ getters }, item) { + axios.put(`https://c3lf.de/api/1/${getters.getEventSlug}/item/${item.iid}`, item, { + auth: getAuth(), + }); + } } }); diff --git a/src/views/Items.vue b/src/views/Items.vue index 9be2289..0c842b9 100644 --- a/src/views/Items.vue +++ b/src/views/Items.vue @@ -5,12 +5,11 @@
@@ -28,7 +27,7 @@ :items="loadedItems" :keyName="'uid'" v-slot="{ item }" - @itemActivated="selectedItem = $event" + @itemActivated="openModalWith($event)" >