blockers
This commit is contained in:
@@ -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';
|
||||
@@ -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 '';
|
||||
}
|
||||
Reference in New Issue
Block a user