diff --git a/packages/pieces/community/zoho-books/package.json b/packages/pieces/community/zoho-books/package.json index b06954aecb..e48bc98971 100644 --- a/packages/pieces/community/zoho-books/package.json +++ b/packages/pieces/community/zoho-books/package.json @@ -1,4 +1,4 @@ { "name": "@activepieces/piece-zoho-books", - "version": "0.0.1" + "version": "0.0.2" } diff --git a/packages/pieces/community/zoho-books/src/index.ts b/packages/pieces/community/zoho-books/src/index.ts index 98c0a15c91..8742baf294 100644 --- a/packages/pieces/community/zoho-books/src/index.ts +++ b/packages/pieces/community/zoho-books/src/index.ts @@ -61,10 +61,13 @@ export const zohoBooks = createPiece({ actions: [ createCustomApiCallAction({ baseUrl: (auth) => - `https://${(auth as OAuth2PropertyValue).data['location']}/books/v3`, + { + const data = (auth as OAuth2PropertyValue).data; + return data && data['api_domain']? `${data['api_domain']}/books/v3` : '' + }, auth: zohoBooksAuth, authMapping: async (auth) => ({ - Authorization: `Bearer ${(auth as OAuth2PropertyValue).access_token}`, + Authorization: `Zoho-oauthtoken ${(auth as OAuth2PropertyValue).access_token}`, }), }), ], diff --git a/packages/pieces/community/zoho-crm/package.json b/packages/pieces/community/zoho-crm/package.json index 51b4c29671..edda87d22c 100644 --- a/packages/pieces/community/zoho-crm/package.json +++ b/packages/pieces/community/zoho-crm/package.json @@ -1,4 +1,4 @@ { "name": "@activepieces/piece-zoho-crm", - "version": "0.1.7" + "version": "0.1.8" } \ No newline at end of file diff --git a/packages/pieces/community/zoho-crm/src/index.ts b/packages/pieces/community/zoho-crm/src/index.ts index 85276fcdc6..02ef5d9dcc 100644 --- a/packages/pieces/community/zoho-crm/src/index.ts +++ b/packages/pieces/community/zoho-crm/src/index.ts @@ -65,10 +65,14 @@ export const zohoCrm = createPiece({ readFile, createCustomApiCallAction({ baseUrl: (auth) => - `https://${(auth as OAuth2PropertyValue).data.location}/crm/v4`, + { + const data = (auth as OAuth2PropertyValue).data; + return data && data['api_domain']? `${data['api_domain']}/crm/v3` : '' + }, + auth: zohoCrmAuth, authMapping: async (auth) => ({ - Authorization: `Bearer ${(auth as OAuth2PropertyValue).access_token}`, + Authorization: `Zoho-oauthtoken ${(auth as OAuth2PropertyValue).access_token}`, }), }), ], diff --git a/packages/react-ui/src/app/connections/create-edit-connection-dialog.tsx b/packages/react-ui/src/app/connections/create-edit-connection-dialog.tsx index c963d86126..50dbaedde7 100644 --- a/packages/react-ui/src/app/connections/create-edit-connection-dialog.tsx +++ b/packages/react-ui/src/app/connections/create-edit-connection-dialog.tsx @@ -154,7 +154,7 @@ const CreateOrEditConnectionDialog = React.memo( }, onError: (err) => { if (err instanceof ConnectionNameAlreadyExists) { - form.setError('request.externalId', { + form.setError('request.displayName', { message: t('Name is already used'), }); } else if (api.isError(err)) { diff --git a/packages/react-ui/src/app/connections/oauth2-connection-settings.tsx b/packages/react-ui/src/app/connections/oauth2-connection-settings.tsx index b829f88605..e20302ba39 100644 --- a/packages/react-ui/src/app/connections/oauth2-connection-settings.tsx +++ b/packages/react-ui/src/app/connections/oauth2-connection-settings.tsx @@ -165,9 +165,17 @@ const OAuth2ConnectionSettings = ({ const clientSecret = (form.getValues().request as UpsertOAuth2Request) ?.value?.client_secret; const hasClientSecret = !isNil(clientSecret); + const propsValues = form.getValues('request.value.props') ?? {}; + const arePropsValid = authProperty.props + ? Object.keys(authProperty.props).reduce((acc, key) => { + return acc && !isNil(propsValues[key]) && propsValues[key] !== ''; + }, true) + : true; + setReadyToConnect( baseCriteria && - (currentOAuth2Type !== AppConnectionType.OAUTH2 || hasClientSecret), + (currentOAuth2Type !== AppConnectionType.OAUTH2 || hasClientSecret) && + arePropsValid, ); }, [watchedForm]);