File tree Expand file tree Collapse file tree 2 files changed +10
-7
lines changed
Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change 1- import axios from "axios" ;
1+ import axios , { InternalAxiosRequestConfig } from "axios" ;
22
33const 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 } ` ;
Original file line number Diff line number Diff line change 11import React , { useState } from "react" ;
22import { useNavigate } from "react-router-dom" ;
33import { api } from "../api/client" ;
4+ import { AxiosError } from "axios" ;
45import {
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 ) ;
You can’t perform that action at this time.
0 commit comments