Skip to content

Commit

Permalink
[gh-#791] await initiate and return null if sync exists (#796)
Browse files Browse the repository at this point in the history
  • Loading branch information
khaliqgant authored Jul 18, 2023
1 parent a95d434 commit e5b5e12
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/server/lib/controllers/oauth.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ class OAuthController {

if (updatedConnection) {
const syncClient = await SyncClient.getInstance();
syncClient?.initiate(updatedConnection.id);
await syncClient?.initiate(updatedConnection.id);
}

await updateSuccessActivityLog(activityLogId, true);
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/lib/services/sync/sync.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const createSync = async (nangoConnectionId: number, name: string): Promi
const existingSync = await getSyncByIdAndName(nangoConnectionId, name);

if (existingSync) {
throw new Error(`Sync with name ${name} already exists. Please reach out to support to report this issue.`);
return null;
}

const sync: Sync = {
Expand Down

0 comments on commit e5b5e12

Please sign in to comment.