diff --git a/web/src/store/index.js b/web/src/store/index.js
index 64cf382..12ae214 100644
--- a/web/src/store/index.js
+++ b/web/src/store/index.js
@@ -202,10 +202,13 @@ const store = new Vuex.Store({
store.commit('logout');
router.push('/login');
},
- async afterLogin() {
- await store.dispatch('loadBoxes');
- await store.dispatch('loadEventItems');
- await store.dispatch('loadTickets');
+ async afterLogin({dispatch}) {
+ await dispatch('loadBoxes');
+ await dispatch('loadEventItems');
+ await dispatch('loadTickets');
+ },
+ async fetchImage({state}, url) {
+ return await fetch(url, {headers: {'Authorization': `Token ${state.token}`}}).then(r => r.blob());
},
async loadEvents({commit}) {
const {data} = await axios.get('/2/events/');
diff --git a/web/src/views/Items.vue b/web/src/views/Items.vue
index bb3f7f6..32fa477 100644
--- a/web/src/views/Items.vue
+++ b/web/src/views/Items.vue
@@ -44,10 +44,10 @@
v-slot="{ item }"
@itemActivated="openLightboxModalWith($event)"
>
-
+ />
{{ item.description }}
uid: {{ item.uid }} box: {{ item.box }}
@@ -76,6 +76,7 @@ import Modal from '@/components/Modal';
import EditItem from '@/components/EditItem';
import {mapActions, mapState} from 'vuex';
import Lightbox from '../components/Lightbox';
+import AuthenticatedImage from "@/components/AuthenticatedImage.vue";
export default {
name: 'Items',
@@ -83,7 +84,7 @@ export default {
lightboxItem: null,
editingItem: null,
}),
- components: {Lightbox, Table, Cards, Modal, EditItem},
+ components: {AuthenticatedImage, Lightbox, Table, Cards, Modal, EditItem},
computed: mapState(['loadedItems', 'layout']),
methods: {
...mapActions(['deleteItem', 'markItemReturned']),