website refactor

This commit is contained in:
2026-01-16 01:00:03 +01:00
parent ce7be39155
commit a98e3e3166
286 changed files with 5522 additions and 5261 deletions

View File

@@ -13,10 +13,17 @@ export function useFindDriverById(
const queryResult = useQuery({
queryKey: ['driver', driverId],
queryFn: () => driverService.findById(driverId),
queryFn: async () => {
const result = await driverService.findById(driverId);
if (result.isErr()) {
const error = result.getError();
throw new ApiError(error.message, 'SERVER_ERROR', { timestamp: new Date().toISOString() });
}
return result.unwrap();
},
enabled: !!driverId,
...options,
});
return enhanceQueryResult(queryResult);
}
}