cleanup tests
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
import { useAuthStore } from "@/auth";
|
import { useAuthStore } from "@/auth";
|
||||||
import { marbasAxiosInstance } from "@/service";
|
import { marbasAxiosInstance } from "@/service";
|
||||||
import { defineStore } from "pinia";
|
import { defineStore } from "pinia";
|
||||||
import { computed, onMounted, ref } from "vue";
|
import { computed, ref } from "vue";
|
||||||
|
|
||||||
export type AcquiredMarketItem = {
|
export type AcquiredMarketItem = {
|
||||||
id: number;
|
id: number;
|
||||||
@@ -60,9 +60,7 @@ export const useAcquiredItemStore = defineStore('market-acquisition', () => {
|
|||||||
await marbasAxiosInstance.put(`${endpoint}/${item.id}`, item);
|
await marbasAxiosInstance.put(`${endpoint}/${item.id}`, item);
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(async () => {
|
marbasAxiosInstance.get<AcquiredMarketItem[]>(endpoint).then(res => acquiredItems.value = res.data.filter(item => item.remaining > 0));
|
||||||
acquiredItems.value = (await marbasAxiosInstance.get<AcquiredMarketItem[]>(endpoint)).data.filter(item => item.remaining > 0);
|
|
||||||
});
|
|
||||||
|
|
||||||
return { items, addAcquiredItem, removeAcquiredItem };
|
return { items, addAcquiredItem, removeAcquiredItem };
|
||||||
});
|
});
|
||||||
@@ -8,7 +8,10 @@ export const logResource = (a: AxiosInstance) => {
|
|||||||
log.debug(`[${r.config.method?.toUpperCase()}] ${r.config.url}`);
|
log.debug(`[${r.config.method?.toUpperCase()}] ${r.config.url}`);
|
||||||
return r;
|
return r;
|
||||||
}, e => {
|
}, e => {
|
||||||
log.error(`[${e.config.method?.toUpperCase()}] ${e.config.url} failed with ${e.response?.status} ${e.response?.statusText}`);
|
if (e instanceof Error) {
|
||||||
|
log.error(e.message);
|
||||||
|
}
|
||||||
|
log.error(`[${e.config?.method?.toUpperCase()}] ${e.config?.url} failed with ${e.response?.status} ${e.response?.statusText}`);
|
||||||
return Promise.reject(e);
|
return Promise.reject(e);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user