@@ -8,7 +8,6 @@ import { z } from "zod";
88
99import LicenseRequired from "@calcom/features/ee/common/components/LicenseRequired" ;
1010import { subdomainSuffix } from "@calcom/features/ee/organizations/lib/orgDomains" ;
11- import { WEBAPP_URL } from "@calcom/lib/constants" ;
1211import { getPlaceholderAvatar } from "@calcom/lib/defaultAvatarImage" ;
1312import { useLocale } from "@calcom/lib/hooks/useLocale" ;
1413import { md } from "@calcom/lib/markdownIt" ;
@@ -69,7 +68,7 @@ const OrgProfileView = () => {
6968 onSuccess : ( org ) => {
7069 if ( org ) {
7170 form . setValue ( "name" , org . name || "" ) ;
72- form . setValue ( "slug" , org . slug || "" ) ;
71+ form . setValue ( "slug" , org . slug || org . metadata ?. requestedSlug || "" ) ;
7372 form . setValue ( "logo" , org . logo || "" ) ;
7473 form . setValue ( "bio" , org . bio || "" ) ;
7574 if ( org . slug === null && ( org ?. metadata as Prisma . JsonObject ) ?. requestedSlug ) {
@@ -89,20 +88,8 @@ const OrgProfileView = () => {
8988 ! currentOrganisation . bio ||
9089 ! currentOrganisation . bio . replace ( "<p><br></p>" , "" ) . length ;
9190
92- const deleteTeamMutation = trpc . viewer . teams . delete . useMutation ( {
93- async onSuccess ( ) {
94- await utils . viewer . teams . list . invalidate ( ) ;
95- showToast ( t ( "your_org_disbanded_successfully" ) , "success" ) ;
96- router . push ( `${ WEBAPP_URL } /teams` ) ;
97- } ,
98- } ) ;
99-
10091 if ( ! orgBranding ) return null ;
10192
102- function deleteTeam ( ) {
103- if ( currentOrganisation ?. id ) deleteTeamMutation . mutate ( { teamId : currentOrganisation . id } ) ;
104- }
105-
10693 return (
10794 < LicenseRequired >
10895 < Meta title = { t ( "profile" ) } description = { t ( "profile_org_description" ) } />
@@ -168,15 +155,21 @@ const OrgProfileView = () => {
168155 </ div >
169156 ) }
170157 />
171- < div className = "mt-8" >
172- < TextField
173- name = "slug"
174- label = { t ( "org_url" ) }
175- value = { currentOrganisation . slug ?? "" }
176- disabled
177- addOnSuffix = { `.${ subdomainSuffix ( ) } ` }
178- />
179- </ div >
158+ < Controller
159+ control = { form . control }
160+ name = "slug"
161+ render = { ( { field : { value } } ) => (
162+ < div className = "mt-8" >
163+ < TextField
164+ name = "slug"
165+ label = { t ( "org_url" ) }
166+ value = { value }
167+ disabled
168+ addOnSuffix = { `.${ subdomainSuffix ( ) } ` }
169+ />
170+ </ div >
171+ ) }
172+ />
180173 < div className = "mt-8" >
181174 < Label > { t ( "about" ) } </ Label >
182175 < Editor
0 commit comments