Skip to content

Commit 37c54d8

Browse files
TamTunnelTamTunnel
authored andcommitted
Fix frontend linting errors (no-explicit-any)
1 parent e671957 commit 37c54d8

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

frontend/web/src/api/client.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import axios from "axios";
1+
import axios, { InternalAxiosRequestConfig } from "axios";
22

33
const coreOrbitsApi = axios.create({
44
baseURL: import.meta.env.VITE_CORE_ORBITS_URL || "http://localhost:8001",
@@ -17,7 +17,7 @@ const aiAgentsApi = axios.create({
1717
});
1818

1919
// Add auth token to requests
20-
const addAuthToken = (config: any) => {
20+
const addAuthToken = (config: InternalAxiosRequestConfig) => {
2121
const token = localStorage.getItem("token");
2222
if (token) {
2323
config.headers.Authorization = `Bearer ${token}`;

frontend/web/src/pages/Login.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React, { useState } from "react";
22
import { useNavigate } from "react-router-dom";
33
import { api } from "../api/client";
4+
import { AxiosError } from "axios";
45
import {
56
Rocket,
67
Shield,
@@ -43,9 +44,10 @@ export default function Login() {
4344
);
4445

4546
navigate("/");
46-
} catch (err: any) {
47-
console.error(err);
48-
setError(err.response?.data?.detail || "Login failed");
47+
} catch (err) {
48+
const error = err as AxiosError<{ detail: string }>;
49+
console.error(error);
50+
setError(error.response?.data?.detail || "Login failed");
4951
} finally {
5052
setLoading(false);
5153
}
@@ -75,8 +77,9 @@ export default function Login() {
7577
try {
7678
await api.seedDemo();
7779
setSuccess("Demo data initialized successfully!");
78-
} catch (err: any) {
79-
console.error(err);
80+
} catch (err) {
81+
const error = err as AxiosError<{ detail: string }>;
82+
console.error(error);
8083
setError("Failed to seed demo data. Is the backend running?");
8184
} finally {
8285
setSeedLoading(false);

0 commit comments

Comments
 (0)