File tree Expand file tree Collapse file tree 1 file changed +18
-12
lines changed
components/server/src/orgs Expand file tree Collapse file tree 1 file changed +18
-12
lines changed Original file line number Diff line number Diff line change @@ -12,12 +12,12 @@ import {
1212 OrganizationSettings ,
1313 TeamMembershipInvite ,
1414} from "@gitpod/gitpod-protocol" ;
15+ import { IAnalyticsWriter } from "@gitpod/gitpod-protocol/lib/analytics" ;
16+ import { ApplicationError , ErrorCodes } from "@gitpod/gitpod-protocol/lib/messaging/error" ;
17+ import { log } from "@gitpod/gitpod-protocol/lib/util/logging" ;
1518import { inject , injectable } from "inversify" ;
1619import { Authorizer } from "../authorization/authorizer" ;
17- import { ErrorCodes , ApplicationError } from "@gitpod/gitpod-protocol/lib/messaging/error" ;
1820import { ProjectsService } from "../projects/projects-service" ;
19- import { IAnalyticsWriter } from "@gitpod/gitpod-protocol/lib/analytics" ;
20- import { log } from "@gitpod/gitpod-protocol/lib/util/logging" ;
2121
2222@injectable ( )
2323export class OrganizationService {
@@ -75,15 +75,21 @@ export class OrganizationService {
7575
7676 throw err ;
7777 }
78- this . analytics . track ( {
79- userId,
80- event : "team_created" ,
81- properties : {
82- id : result . id ,
83- name : result . name ,
84- created_at : result . creationTime ,
85- } ,
86- } ) ;
78+ try {
79+ const invite = await this . teamDB . resetGenericInvite ( result . id ) ;
80+ this . analytics . track ( {
81+ userId,
82+ event : "team_created" ,
83+ properties : {
84+ id : result . id ,
85+ name : result . name ,
86+ created_at : result . creationTime ,
87+ invite_id : invite . id ,
88+ } ,
89+ } ) ;
90+ } catch ( error ) {
91+ log . error ( "Failed to track team_created event." , error ) ;
92+ }
8793 return result ;
8894 }
8995
You can’t perform that action at this time.
0 commit comments