@@ -32,6 +32,7 @@ import {
3232 useCreateEmployment ,
3333 useEmployment ,
3434 useJSONSchemaForm ,
35+ useUpdateEmployment ,
3536} from '@/src/flows/Onboarding/api' ;
3637import {
3738 disabledInviteButtonEmploymentStatus ,
@@ -144,8 +145,15 @@ export const useContractorOnboarding = ({
144145 } , [ employmentStatus ] ) ;
145146
146147 const createEmploymentMutation = useCreateEmployment ( ) ;
148+ const updateEmploymentMutation = useUpdateEmployment (
149+ internalCountryCode as string ,
150+ options ,
151+ ) ;
147152 const createContractorContractDocumentMutation =
148153 useCreateContractorContractDocument ( ) ;
154+ const { mutateAsync : updateEmploymentMutationAsync } = mutationToPromise (
155+ updateEmploymentMutation ,
156+ ) ;
149157 const signContractDocumentMutation = useSignContractDocument ( ) ;
150158 const manageContractorSubscriptionMutation =
151159 usePostManageContractorSubscriptions ( ) ;
@@ -655,10 +663,9 @@ export const useContractorOnboarding = ({
655663 throw error ;
656664 }
657665 } else if ( internalEmploymentId ) {
658- // TODO: Provisional it seems you cannot update a contractor employment
659- // TODO: we'll need to check later if the provisional start date gets updated for the statement of work
660- return Promise . resolve ( {
661- data : { employmentId : internalEmploymentId } ,
666+ return updateEmploymentMutationAsync ( {
667+ employmentId : internalEmploymentId ,
668+ basic_information : parsedValues ,
662669 } ) ;
663670 }
664671
0 commit comments