refactor(http): removed axios; changed all requests to native fetch

This commit is contained in:
2026-04-01 15:00:57 +02:00
parent ef105f680d
commit e1f4a740ac
12 changed files with 108 additions and 156 deletions
@@ -269,9 +269,9 @@ export default defineComponent({
this.searchTimeout = window.setTimeout(async () => {
try {
const suggestions: string[] = await (
await this.apiStore.client!.get(`api/get${type}Suggestions?name=${value}`)
).data;
const suggestions: string[] = await this.apiStore.client.get(
`api/get${type}Suggestions?name=${value}`
);
this[`${type}Suggestions`] = suggestions;
} catch (error) {
@@ -201,22 +201,20 @@ const driverRouteLocation = computed<RouteLocationRaw | null>(() => {
async function fetchTimetableDetails() {
try {
const responseData = await apiStore.client!.get<API.TimetableHistory.Response>(
const responseData = await apiStore.client.get<API.TimetableHistory.Response>(
'api/getTimetables',
{
params: {
timetableId: props.timetableEntry.id,
returnType: 'detailed'
}
timetableId: props.timetableEntry.id,
returnType: 'detailed'
}
);
if (!responseData || responseData.data.length != 1) {
if (!responseData || responseData.length != 1) {
timetableDetails.value = null;
return;
}
timetableDetails.value = responseData.data[0];
timetableDetails.value = responseData[0];
} catch (error) {
// this.dataStatus = Status.Data.Error;
console.error(error);