Skip to content

Commit

Permalink
feat: allow upsert existing basic connection (#2181)
Browse files Browse the repository at this point in the history
## Describe your changes

Following our conversation with Thomas, we agree that we can allow
upsert existing basic connection.

It is already allowed for Oauth2 and ApiKey connection but not for basic
credentials.

This PR remove the check which disallow the import of an existing
connection with basic credentials.

## Issue ticket number and link

## Checklist before requesting a review (skip if just adding/editing
APIs & templates)
- [ ] I added tests, otherwise the reason is: 
- [ ] I added observability, otherwise the reason is:
- [ ] I added analytics, otherwise the reason is:
  • Loading branch information
descampsk authored May 23, 2024
1 parent 4b4f56b commit e3a4cb7
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions packages/shared/lib/services/connection.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,12 +238,6 @@ class ConnectionService {
credentials: BasicApiCredentials | ApiKeyCredentials,
connectionCreatedHook: (res: ConnectionUpsertResponse) => Promise<void>
) {
const connection = await this.checkIfConnectionExists(connection_id, provider_config_key, environmentId);

if (connection) {
throw new NangoError('connection_already_exists');
}

const [importedConnection] = await this.upsertApiConnection(connection_id, provider_config_key, provider, credentials, {}, environmentId, accountId);

if (importedConnection) {
Expand Down

0 comments on commit e3a4cb7

Please sign in to comment.