(computed(() => props.items
.filter(r => r.type.name.toLowerCase().includes(filter.value.toLowerCase()))
@@ -107,7 +107,7 @@ const getLineColor = (result: Result) => {
| {{ formatIsk(r.sell) }} |
{{ formatIsk(r.price) }} |
{{ r.count }} |
- {{ percentFormater.format(r.precentProfit) }} |
+ {{ percentFormater.format(r.precentProfit) }} |
{{ formatIsk(r.iskProfit) }} |
diff --git a/src/market/acquisition/acquisition.ts b/src/market/acquisition/acquisition.ts
index 37ab4c6..8d4f3ca 100644
--- a/src/market/acquisition/acquisition.ts
+++ b/src/market/acquisition/acquisition.ts
@@ -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([]);
+ 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) => {
diff --git a/src/market/type/MarketTypeInput.vue b/src/market/type/MarketTypeInput.vue
index 03df28d..5bf6ff5 100644
--- a/src/market/type/MarketTypeInput.vue
+++ b/src/market/type/MarketTypeInput.vue
@@ -96,7 +96,7 @@ watchEffect(async () => {
isOpen = true" v-on-click-outside="() => isOpen = false">
diff --git a/src/routes.ts b/src/routes.ts
index 3d2857c..d150dcb 100644
--- a/src/routes.ts
+++ b/src/routes.ts
@@ -11,5 +11,5 @@ export const routes: RouteRecordRaw[] = [
{ path: 'acquisitions', component: () => import('@/pages/market/Acquisitions.vue') },
] },
{ path: '/tools', component: () => import('@/pages/Tools.vue') },
- { path: '/about', component: () => import('@/pages/About.vue') },
+ { path: '/about', name: 'about', component: () => import('@/pages/About.vue') },
];
\ No newline at end of file
diff --git a/src/service.ts b/src/service.ts
index 315addc..9af37d0 100644
--- a/src/service.ts
+++ b/src/service.ts
@@ -44,7 +44,13 @@ marbasAxiosInstance.interceptors.response.use(async r => {
return r;
})
marbasAxiosInstance.interceptors.request.use(r => {
- const accessToken = useAuthStore().accessToken;
+ const authStore = useAuthStore();
+
+ if (!authStore.isLoggedIn) {
+ throw new Error("Not logged in");
+ }
+
+ const accessToken = authStore.accessToken;
if (accessToken) {
r.headers.Authorization = `Bearer ${accessToken}`;
diff --git a/src/sidebar/Sidebar.vue b/src/sidebar/Sidebar.vue
index 6e38ea8..32e7d60 100644
--- a/src/sidebar/Sidebar.vue
+++ b/src/sidebar/Sidebar.vue
@@ -1,5 +1,6 @@
|