feat(#31): implemented api for environment crud operations

This commit is contained in:
akhilmhdh
2023-01-11 23:10:11 +05:30
parent 861639de27
commit 3ad3e19bcf
15 changed files with 293 additions and 37 deletions
@@ -31,11 +31,17 @@ export const oAuthExchange = async (
if (!INTEGRATION_SET.has(integration))
throw new Error('Failed to validate integration');
const environments = req.membership.workspace?.environments || [];
if(environments.length === 0){
throw new Error("Failed to get environments")
}
await IntegrationService.handleOAuthExchange({
workspaceId,
integration,
code
code,
environment: environments[0].slug,
});
} catch (err) {
Sentry.setUser(null);