From d952b1e5e605c21fc43ffe240e9f6addd6ad9bd2 Mon Sep 17 00:00:00 2001 From: steinhelge Date: Sun, 23 Nov 2025 22:35:37 +0100 Subject: [PATCH] Fix auth types export issue --- src/hospitality-web/src/lib/api.ts | 20 ++++---------------- src/hospitality-web/src/types/auth.ts | 15 +++++++++++++++ 2 files changed, 19 insertions(+), 16 deletions(-) create mode 100644 src/hospitality-web/src/types/auth.ts diff --git a/src/hospitality-web/src/lib/api.ts b/src/hospitality-web/src/lib/api.ts index 1ce0e87..1db0993 100644 --- a/src/hospitality-web/src/lib/api.ts +++ b/src/hospitality-web/src/lib/api.ts @@ -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 => { const response = await axios.post(`${API_BASE_URL}/auth/login`, data); diff --git a/src/hospitality-web/src/types/auth.ts b/src/hospitality-web/src/types/auth.ts new file mode 100644 index 0000000..220ba71 --- /dev/null +++ b/src/hospitality-web/src/types/auth.ts @@ -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[]; +}