code quality
Some checks failed
CI / lint-typecheck (pull_request) Failing after 12s
CI / tests (pull_request) Has been skipped
CI / contract-tests (pull_request) Has been skipped
CI / e2e-tests (pull_request) Has been skipped
CI / comment-pr (pull_request) Has been skipped
CI / commit-types (pull_request) Has been skipped
Some checks failed
CI / lint-typecheck (pull_request) Failing after 12s
CI / tests (pull_request) Has been skipped
CI / contract-tests (pull_request) Has been skipped
CI / e2e-tests (pull_request) Has been skipped
CI / comment-pr (pull_request) Has been skipped
CI / commit-types (pull_request) Has been skipped
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
import { DriverProfileViewModelBuilder } from '@/lib/builders/view-models/DriverProfileViewModelBuilder';
|
||||
import { DriverProfileViewDataBuilder } from '@/lib/builders/view-data/DriverProfileViewDataBuilder';
|
||||
import { useInject } from '@/lib/di/hooks/useInject';
|
||||
import { DRIVER_SERVICE_TOKEN } from '@/lib/di/tokens';
|
||||
import { ApiError } from '@/lib/gateways/api/base/ApiError';
|
||||
import type { GetDriverProfileOutputDTO } from '@/lib/types/generated/GetDriverProfileOutputDTO';
|
||||
import { DriverProfileViewModel } from '@/lib/view-models/DriverProfileViewModel';
|
||||
import type { DriverProfileViewData } from '@/lib/view-data/DriverProfileViewData';
|
||||
import { useMutation, UseMutationOptions } from '@tanstack/react-query';
|
||||
|
||||
export function useUpdateDriverProfile(
|
||||
options?: Omit<UseMutationOptions<DriverProfileViewModel, ApiError, { bio?: string; country?: string }>, 'mutationFn'>
|
||||
options?: Omit<UseMutationOptions<DriverProfileViewData, ApiError, { bio?: string; country?: string }>, 'mutationFn'>
|
||||
) {
|
||||
const driverService = useInject(DRIVER_SERVICE_TOKEN);
|
||||
|
||||
return useMutation<DriverProfileViewModel, ApiError, { bio?: string; country?: string }>({
|
||||
return useMutation<DriverProfileViewData, ApiError, { bio?: string; country?: string }>({
|
||||
mutationFn: async (updates) => {
|
||||
await driverService.updateProfile(updates);
|
||||
|
||||
@@ -21,7 +21,7 @@ export function useUpdateDriverProfile(
|
||||
|
||||
// This hook does not know the driverId; callers should invalidate/refetch the profile query.
|
||||
// Return a minimal ViewModel to satisfy types.
|
||||
return DriverProfileViewModelBuilder.build({
|
||||
return DriverProfileViewDataBuilder.build({
|
||||
teamMemberships: [],
|
||||
socialSummary: { friends: [], friendsCount: 0 },
|
||||
} as unknown as GetDriverProfileOutputDTO);
|
||||
|
||||
Reference in New Issue
Block a user