Skip to content

Commit

Permalink
fix: delete connector config
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyxiao committed Dec 19, 2023
1 parent 4a61595 commit 1396ce7
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions packages/engine-backend/router/connectorConfigRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,18 @@ export const connectorConfigRouter = trpc.router({
.mutation(async ({input: {id: ccfgId}, ctx}) => {
const provider = ctx.connectorMap[extractConnectorName(ccfgId)]
if (provider?.metadata?.nangoProvider) {
await ctx.nango.delete('/config/{provider_config_key}', {
path: {provider_config_key: ccfgId},
})
await ctx.nango
.delete('/config/{provider_config_key}', {
path: {provider_config_key: ccfgId},
})
.catch(async (err) => {
await ctx.nango.get('/config/{provider_config_key}', {
path: {provider_config_key: ccfgId},
query: {},
})
// What happens to error case? Do we get 404? Wish openAPI spec specifies this...
throw err
})
}
return ctx.services.metaService.tables.connector_config.delete(ccfgId)
}),
Expand Down

1 comment on commit 1396ce7

@vercel
Copy link

@vercel vercel bot commented on 1396ce7 Dec 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

venice – ./

venice-git-production-venice.vercel.app
venice-venice.vercel.app
usevenice.vercel.app
app.venice.is

Please sign in to comment.