fix marbas proxy

This commit is contained in:
2023-10-30 10:50:47 +01:00
parent 1f1821d607
commit 75f70cfd25
5 changed files with 29 additions and 20 deletions

View File

@@ -1,4 +1,4 @@
import { apiAxiosInstance } from "@/service";
import { marbasAxiosInstance } from "@/service";
export type MarketType = {
id: number;
@@ -18,9 +18,9 @@ export const getMarketTypes = async (types: (string | number)[]): Promise<Market
if (types.length === 0) {
return [];
} else if (types.length === 1 && typeof types[0] === "number") {
return [(await apiAxiosInstance.get<MarketType>(`/sde/types/${types[0]}/`)).data];
return [(await marbasAxiosInstance.get<MarketType>(`/sde/types/${types[0]}/`)).data];
}
return (await apiAxiosInstance.post<MarketType[]>("/api/types/search", types.map(t => {
return (await marbasAxiosInstance.post<MarketType[]>("/api/types/search", types.map(t => {
if (typeof t === "number") {
return { id: t };
} else {
@@ -49,7 +49,7 @@ const blueprintMarketGrous = [ // TODO add all groups
]
export const searchMarketTypes = async (search: string): Promise<MarketType[]> => {
return (await apiAxiosInstance.post<MarketType[]>("/api/types/search", [{
return (await marbasAxiosInstance.post<MarketType[]>("/api/types/search", [{
name__icontains: search,
marketgroup_id___not: null,
marketgroup_id__in___not: blueprintMarketGrous,