Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/client/sdk.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2569,8 +2569,9 @@ export const postCancelEmployeeTimeoff = <ThrowOnError extends boolean = false>(
*
* ```
*
* This endpoint requires a company access token, as forms are dependent on certain
* properties of companies and their current employments.
* Most forms require a company access token, as they are dependent on certain
* properties of companies and their current employments. However, the `address_details`
* form can be accessed using client_credentials authentication (without a company).
*
*
*/
Expand All @@ -2585,6 +2586,7 @@ export const getShowFormCountry = <ThrowOnError extends boolean = false>(
security: [
{ scheme: 'bearer', type: 'http' },
{ scheme: 'bearer', type: 'http' },
{ scheme: 'bearer', type: 'http' },
],
url: '/v1/countries/{country_code}/{form}',
...options,
Expand Down
5 changes: 5 additions & 0 deletions src/client/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3820,6 +3820,7 @@ export type MinimalEmployment = {
work_address_details: {
[key: string]: unknown;
};
work_email: string | null;
};

/**
Expand Down Expand Up @@ -8914,6 +8915,10 @@ export type GetShowContractorContractDetailsCountryData = {
country_code: string;
};
query?: {
/**
* Employment ID
*/
employment_id?: string;
/**
* Version of the form schema
*/
Expand Down
9 changes: 8 additions & 1 deletion src/flows/ContractorOnboarding/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,24 +231,31 @@ export const useCreateContractorContractDocument = () => {
*/
export const useContractorOnboardingDetailsSchema = ({
countryCode,
employmentId,
fieldValues,
options,
}: {
countryCode: string;
fieldValues: FieldValues;
employmentId: string;
options?: FlowOptions & { queryOptions?: { enabled?: boolean } };
query?: Record<string, unknown>;
}): UseQueryResult<JSONSchemaFormResultWithFieldsets> => {
const { client } = useClient();
return useQuery({
queryKey: ['contractor-onboarding-details-schema', countryCode],
queryKey: [
'contractor-onboarding-details-schema',
countryCode,
employmentId,
],
retry: false,
queryFn: async () => {
return getShowContractorContractDetailsCountry({
client: client as Client,
path: { country_code: countryCode },
query: {
json_schema_version: 1,
employment_id: employmentId,
},
});
},
Expand Down
1 change: 1 addition & 0 deletions src/flows/ContractorOnboarding/hooks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,7 @@ export const useContractorOnboarding = ({
} = useContractorOnboardingDetailsSchema({
countryCode: internalCountryCode as string,
fieldValues: fieldValues,
employmentId: internalEmploymentId as string,
options: {
queryOptions: {
enabled: isContractorOnboardingDetailsEnabled,
Expand Down
Loading