This commit is contained in:
2025-12-18 14:30:19 +01:00
parent bf1f09c774
commit b476bb7e99
29 changed files with 273 additions and 307 deletions

View File

@@ -1,12 +0,0 @@
/**
* @deprecated This legacy API client has been refactored into domain-specific clients.
* Please use the new API client from './api' instead.
*
* TODO: Remove this file once all consumers have migrated to the new API client structure.
*/
// Re-export the new API client for backward compatibility
export { api as apiClient } from './api';
// Re-export DTO types for backward compatibility
export type * from './dtos';

View File

@@ -1,26 +0,0 @@
'use client';
import { useAuth } from '@/lib/auth/AuthContext';
/**
* Returns the effective driver ID for the current session.
*
* Prefers the authenticated user's primaryDriverId when available,
* otherwise returns an empty string (user must log in to have a driver).
*/
export function useEffectiveDriverId(): string {
const { session } = useAuth();
const user = session?.user as
| {
primaryDriverId?: string | null;
}
| undefined;
// Return the user's primary driver ID if available
if (user?.primaryDriverId) {
return user.primaryDriverId;
}
// No driver ID available - user needs to log in or complete onboarding
return '';
}