Fix auth types export issue

This commit is contained in:
steinhelge
2025-11-23 22:35:37 +01:00
parent 20af7d5b52
commit d952b1e5e6
2 changed files with 19 additions and 16 deletions
+4 -16
View File
@@ -1,4 +1,5 @@
import axios from 'axios';
import type { LoginRequest, LoginResponse, UserInfo } from '../types/auth';
const API_BASE_URL = 'http://localhost:5163/api';
@@ -34,23 +35,10 @@ api.interceptors.response.use(
}
);
// Re-export types for convenience
export type { LoginRequest, LoginResponse, UserInfo };
// Auth API
export interface LoginRequest {
email: string;
password: string;
}
export interface LoginResponse {
token: string;
email: string;
roles: string[];
}
export interface UserInfo {
email: string;
roles: string[];
}
export const authApi = {
login: async (data: LoginRequest): Promise<LoginResponse> => {
const response = await axios.post(`${API_BASE_URL}/auth/login`, data);
+15
View File
@@ -0,0 +1,15 @@
export interface LoginRequest {
email: string;
password: string;
}
export interface LoginResponse {
token: string;
email: string;
roles: string[];
}
export interface UserInfo {
email: string;
roles: string[];
}