User dropdown
User id in acquisition about
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { useAuthStore } from "@/auth";
|
||||
import { marbasAxiosInstance } from "@/service";
|
||||
import { defineStore } from "pinia";
|
||||
import { computed, onMounted, ref } from "vue";
|
||||
@@ -17,6 +18,7 @@ const endpoint = '/api/acquisitions';
|
||||
|
||||
export const useAcquiredItemStore = defineStore('market-acquisition', () => {
|
||||
const _acquiredItems = ref<AcquiredMarketItem[]>([]);
|
||||
const authStore = useAuthStore();
|
||||
|
||||
const items = computed(() => _acquiredItems.value);
|
||||
const addAcquiredItem = async (type: number, quantity: number, price: number) => {
|
||||
@@ -27,7 +29,7 @@ export const useAcquiredItemStore = defineStore('market-acquisition', () => {
|
||||
price: price,
|
||||
date: new Date(),
|
||||
source: 'bo',
|
||||
user: 0 // TODO: get user id
|
||||
user: authStore.userId,
|
||||
})).data];
|
||||
};
|
||||
const removeAcquiredItem = async (type: number, quantity: number) => {
|
||||
|
||||
Reference in New Issue
Block a user