Endpoint update with '/api' prepend

This commit is contained in:
EmanueleAlfano
2026-02-04 09:28:01 +01:00
parent 907822f168
commit 077f864315
2 changed files with 8 additions and 8 deletions

View File

@@ -55,7 +55,7 @@ def find_user(badge_code: str) -> dict | None:
return None return None
@router.get("/info-room", response_model=RoomInfoResponse) @router.get("/api/info-room", response_model=RoomInfoResponse)
async def get_room_info(): async def get_room_info():
"""Restituisce le informazioni sulla sala e la riunione corrente.""" """Restituisce le informazioni sulla sala e la riunione corrente."""
return RoomInfoResponse( return RoomInfoResponse(
@@ -65,7 +65,7 @@ async def get_room_info():
) )
@router.post("/login-validate", response_model=LoginResponse) @router.post("/api/login-validate", response_model=LoginResponse)
async def login_validate(request: LoginRequest): async def login_validate(request: LoginRequest):
""" """
Valida la password del validatore. Valida la password del validatore.
@@ -91,7 +91,7 @@ async def login_validate(request: LoginRequest):
) )
@router.get("/anagrafica/{badge_code}", response_model=UserResponse) @router.get("/api/anagrafica/{badge_code}", response_model=UserResponse)
async def get_user_anagrafica(badge_code: str): async def get_user_anagrafica(badge_code: str):
""" """
Cerca un utente tramite il suo badge code. Cerca un utente tramite il suo badge code.
@@ -120,7 +120,7 @@ async def get_user_anagrafica(badge_code: str):
return response return response
@router.post("/entry-request", response_model=EntryResponse) @router.post("/api/entry-request", response_model=EntryResponse)
async def process_entry_request(request: EntryRequest): async def process_entry_request(request: EntryRequest):
""" """
Processa una richiesta di ingresso. Processa una richiesta di ingresso.

View File

@@ -91,7 +91,7 @@ async function apiFetch<T>(
* Ottiene le informazioni sulla sala e la riunione * Ottiene le informazioni sulla sala e la riunione
*/ */
export async function getRoomInfo(): Promise<RoomInfo> { export async function getRoomInfo(): Promise<RoomInfo> {
return apiFetch<RoomInfo>('/info-room'); return apiFetch<RoomInfo>('/api/info-room');
} }
/** /**
@@ -104,7 +104,7 @@ export async function loginValidator(
): Promise<LoginResponse> { ): Promise<LoginResponse> {
log(`Login attempt for badge: ${badge}`); log(`Login attempt for badge: ${badge}`);
const payload: LoginRequest = {badge, password}; const payload: LoginRequest = {badge, password};
return apiFetch<LoginResponse>('/login-validate', { return apiFetch<LoginResponse>('/api/login-validate', {
method: 'POST', method: 'POST',
body: JSON.stringify(payload), body: JSON.stringify(payload),
}); });
@@ -116,7 +116,7 @@ export async function loginValidator(
*/ */
export async function getUserByBadge(badgeCode: string): Promise<User> { export async function getUserByBadge(badgeCode: string): Promise<User> {
log(`Fetching anagrafica for badge: ${badgeCode}`); log(`Fetching anagrafica for badge: ${badgeCode}`);
return apiFetch<User>(`/anagrafica/${encodeURIComponent(badgeCode)}`); return apiFetch<User>(`/api/anagrafica/${encodeURIComponent(badgeCode)}`);
} }
/** /**
@@ -132,7 +132,7 @@ export async function requestEntry(
user_badge: userBadge, user_badge: userBadge,
validator_password: validatorPassword, validator_password: validatorPassword,
}; };
return apiFetch<EntryResponse>('/entry-request', { return apiFetch<EntryResponse>('/api/entry-request', {
method: 'POST', method: 'POST',
body: JSON.stringify(payload), body: JSON.stringify(payload),
}); });