Endpoint update with '/api' prepend
This commit is contained in:
@@ -55,7 +55,7 @@ def find_user(badge_code: str) -> dict | None:
|
||||
return None
|
||||
|
||||
|
||||
@router.get("/info-room", response_model=RoomInfoResponse)
|
||||
@router.get("/api/info-room", response_model=RoomInfoResponse)
|
||||
async def get_room_info():
|
||||
"""Restituisce le informazioni sulla sala e la riunione corrente."""
|
||||
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):
|
||||
"""
|
||||
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):
|
||||
"""
|
||||
Cerca un utente tramite il suo badge code.
|
||||
@@ -120,7 +120,7 @@ async def get_user_anagrafica(badge_code: str):
|
||||
return response
|
||||
|
||||
|
||||
@router.post("/entry-request", response_model=EntryResponse)
|
||||
@router.post("/api/entry-request", response_model=EntryResponse)
|
||||
async def process_entry_request(request: EntryRequest):
|
||||
"""
|
||||
Processa una richiesta di ingresso.
|
||||
|
||||
@@ -91,7 +91,7 @@ async function apiFetch<T>(
|
||||
* Ottiene le informazioni sulla sala e la riunione
|
||||
*/
|
||||
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> {
|
||||
log(`Login attempt for badge: ${badge}`);
|
||||
const payload: LoginRequest = {badge, password};
|
||||
return apiFetch<LoginResponse>('/login-validate', {
|
||||
return apiFetch<LoginResponse>('/api/login-validate', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify(payload),
|
||||
});
|
||||
@@ -116,7 +116,7 @@ export async function loginValidator(
|
||||
*/
|
||||
export async function getUserByBadge(badgeCode: string): Promise<User> {
|
||||
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,
|
||||
validator_password: validatorPassword,
|
||||
};
|
||||
return apiFetch<EntryResponse>('/entry-request', {
|
||||
return apiFetch<EntryResponse>('/api/entry-request', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify(payload),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user