Skip to content

Commit

Permalink
fix(hooks): update jira hook (#2720)
Browse files Browse the repository at this point in the history
## Describe your changes

- Update Jira hook with baseUrl
  • Loading branch information
hassan254-prog authored Sep 13, 2024
1 parent 1a62759 commit 5453900
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/server/lib/hooks/connection/jira-post-connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export default async function execute(nango: Nango) {
}

const cloudId = response.data[0].id;
const baseUrl = response.data[0].url;

const accountResponse = await nango.proxy({
endpoint: `ex/jira/${cloudId}/rest/api/3/myself`,
Expand All @@ -22,11 +23,11 @@ export default async function execute(nango: Nango) {
});

if (axios.isAxiosError(accountResponse) || !accountResponse || !accountResponse.data || accountResponse.data.length === 0) {
await nango.updateConnectionConfig({ cloudId });
await nango.updateConnectionConfig({ cloudId, baseUrl });
return;
}

const { accountId } = accountResponse.data;

await nango.updateConnectionConfig({ cloudId, accountId });
await nango.updateConnectionConfig({ cloudId, baseUrl, accountId });
}

0 comments on commit 5453900

Please sign in to comment.