update to mabras rework
This commit is contained in:
@@ -20,7 +20,7 @@ export const getMarketTypes = async (types: (string | number)[]): Promise<Market
|
||||
} else if (types.length === 1 && typeof types[0] === "number") {
|
||||
return [(await apiAxiosInstance.get<MarketType>(`/sde/types/${types[0]}/`)).data];
|
||||
}
|
||||
return (await apiAxiosInstance.post<MarketType[]>("/sde/types/search", types.map(t => {
|
||||
return (await apiAxiosInstance.post<MarketType[]>("/api/types/search", types.map(t => {
|
||||
if (typeof t === "number") {
|
||||
return { id: t };
|
||||
} else {
|
||||
@@ -49,9 +49,9 @@ const blueprintMarketGrous = [ // TODO add all groups
|
||||
]
|
||||
|
||||
export const searchMarketTypes = async (search: string): Promise<MarketType[]> => {
|
||||
return (await apiAxiosInstance.post<MarketType[]>("/sde/types/search", [{
|
||||
name__i: search,
|
||||
marketgroup_id__not: null,
|
||||
marketgroup_id__not__in: blueprintMarketGrous,
|
||||
return (await apiAxiosInstance.post<MarketType[]>("/api/types/search", [{
|
||||
name__icontains: search,
|
||||
marketgroup_id___not: null,
|
||||
marketgroup_id__in___not: blueprintMarketGrous,
|
||||
}])).data;
|
||||
}
|
||||
@@ -82,6 +82,7 @@ watchEffect(async () => {
|
||||
suggestions.value = [];
|
||||
} else {
|
||||
suggestions.value = await searchMarketTypes(search);
|
||||
scrollTo(0);
|
||||
}
|
||||
currentIndex.value = -1;
|
||||
})
|
||||
@@ -94,7 +95,7 @@ watchEffect(async () => {
|
||||
<input type="text" v-model="name" @keyup.enter="submit" @keyup.down="moveDown" @keyup.up="moveUp" />
|
||||
</div>
|
||||
<div v-if="suggestions.length > 1" class="z-10 absolute w-96">
|
||||
<div v-bind="containerProps" style="height: 300px">
|
||||
<div v-bind="containerProps" class="rounded-b" style="height: 300px">
|
||||
<div v-bind="wrapperProps">
|
||||
<div v-for="s in list" :key="s.index" class="hover:bg-slate-700" :class="{'bg-slate-500': s.index !== currentIndex, 'bg-emerald-500': s.index === currentIndex}" @click="select(s.data)">
|
||||
<MarketTypeLabel :id="s.data.id" :name="s.data.name" class="whitespace-nowrap overflow-hidden cursor-pointer" hideCopy />
|
||||
|
||||
@@ -20,6 +20,20 @@ export const apiAxiosInstance = axios.create({
|
||||
},
|
||||
})
|
||||
logResource(apiAxiosInstance)
|
||||
apiAxiosInstance.interceptors.response.use(async r => {
|
||||
const next = r.data?.next;
|
||||
let results = r.data?.results;
|
||||
|
||||
if (next) {
|
||||
results = results.concat((await apiAxiosInstance.request({
|
||||
...r.config,
|
||||
url: next,
|
||||
baseURL: '',
|
||||
})).data);
|
||||
}
|
||||
r.data = results;
|
||||
return r;
|
||||
})
|
||||
|
||||
export const evepraisalAxiosInstance = axios.create({
|
||||
baseURL: '/appraisal/',
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
@apply w-3;
|
||||
}
|
||||
::-webkit-scrollbar-track {
|
||||
@apply bg-slate-500;
|
||||
@apply bg-slate-500 rounded;
|
||||
}
|
||||
::-webkit-scrollbar-thumb {
|
||||
@apply bg-slate-600 hover:bg-slate-700;
|
||||
|
||||
Reference in New Issue
Block a user