@@ -862,36 +862,10 @@ async function getTranscripts(bookingUid: string): Promise<BookingTranscript[]>
862862}
863863
864864async function getEventTypes ( ) : Promise < EventType [ ] > {
865- // Get cached user profile to extract username and org slug (uses in-flight deduplication)
866- let username : string | undefined ;
867- let orgSlug : string | undefined ;
868- try {
869- const userProfile = await getUserProfile ( ) ;
870- // Extract username from response
871- if ( userProfile ?. username ) {
872- username = userProfile . username ;
873- }
874- // For org users, include org slug to avoid username collisions across orgs
875- if ( userProfile ?. organization ?. slug ) {
876- orgSlug = userProfile . organization . slug ;
877- }
878- } catch ( _error ) { }
879-
880- // Build query string with username, orgSlug, and sorting
881- const params = new URLSearchParams ( ) ;
882- if ( username ) {
883- params . append ( "username" , username ) ;
884- }
885- if ( orgSlug ) {
886- params . append ( "orgSlug" , orgSlug ) ;
887- }
865+ // For authenticated users, no username/orgSlug params needed - API uses auth token
866+ // This also ensures hidden event types are returned (they're filtered out when username is provided)
888867 // Sort by creation date descending (newer first) to match main codebase behavior
889- // Main codebase uses position: "desc", id: "desc" - since API doesn't expose position,
890- // we use sortCreatedAt: "desc" for similar behavior (newer event types first)
891- params . append ( "sortCreatedAt" , "desc" ) ;
892-
893- const queryString = params . toString ( ) ;
894- const endpoint = `/event-types${ queryString ? `?${ queryString } ` : "" } ` ;
868+ const endpoint = `/event-types?sortCreatedAt=desc` ;
895869
896870 const response = await makeRequest < unknown > ( endpoint , { } , "2024-06-14" ) ;
897871
0 commit comments