@@ -43,7 +43,8 @@ export default async function CompanyFlagsPage({ searchParams }: PageProps) {
4343
4444 const flags =
4545 selectedAppId && selectedEnvId && companyId
46- ? ( await fetchCompanyFlags ( selectedAppId , selectedEnvId , companyId ) ) . data ?? [ ]
46+ ? ( ( await fetchCompanyFlags ( selectedAppId , selectedEnvId , companyId ) )
47+ . data ?? [ ] )
4748 : [ ] ;
4849
4950 async function updateCompanyFlagAction ( formData : FormData ) {
@@ -57,7 +58,11 @@ export default async function CompanyFlagsPage({ searchParams }: PageProps) {
5758
5859 await toggleCompanyFlag ( appId , envId , nextCompanyId , flagKey , nextValue ) ;
5960
60- const query = new URLSearchParams ( { appId, envId, companyId : nextCompanyId } ) ;
61+ const query = new URLSearchParams ( {
62+ appId,
63+ envId,
64+ companyId : nextCompanyId ,
65+ } ) ;
6166 revalidatePath ( "/flags/company" ) ;
6267 redirect ( `/flags/company?${ query . toString ( ) } ` ) ;
6368 }
@@ -94,23 +99,44 @@ export default async function CompanyFlagsPage({ searchParams }: PageProps) {
9499 </ thead >
95100 < tbody >
96101 { flags . map ( ( flag ) => {
97- const isInherited = flag . value && flag . specificTargetValue === null ;
102+ const isInherited =
103+ flag . value && flag . specificTargetValue === null ;
98104
99105 return (
100106 < tr key = { flag . id } style = { { borderTop : "1px solid #ddd" } } >
101107 < td style = { { padding : 8 } } > { flag . name } </ td >
102108 < td style = { { padding : 8 } } > { flag . key } </ td >
103109 < td style = { { padding : 8 } } >
104- { flag . value ? ( isInherited ? "Yes (implicitly)" : "Yes" ) : "No" }
110+ { flag . value
111+ ? isInherited
112+ ? "Yes (implicitly)"
113+ : "Yes"
114+ : "No" }
105115 </ td >
106116 < td style = { { padding : 8 } } >
107117 { ! isInherited && (
108118 < form action = { updateCompanyFlagAction } >
109- < input type = "hidden" name = "appId" value = { selectedAppId } />
110- < input type = "hidden" name = "envId" value = { selectedEnvId } />
111- < input type = "hidden" name = "companyId" value = { companyId } />
119+ < input
120+ type = "hidden"
121+ name = "appId"
122+ value = { selectedAppId }
123+ />
124+ < input
125+ type = "hidden"
126+ name = "envId"
127+ value = { selectedEnvId }
128+ />
129+ < input
130+ type = "hidden"
131+ name = "companyId"
132+ value = { companyId }
133+ />
112134 < input type = "hidden" name = "flagKey" value = { flag . key } />
113- < input type = "hidden" name = "nextValue" value = { String ( ! flag . value ) } />
135+ < input
136+ type = "hidden"
137+ name = "nextValue"
138+ value = { String ( ! flag . value ) }
139+ />
114140 < button type = "submit" >
115141 { flag . value ? "Turn off" : "Turn on" }
116142 </ button >
0 commit comments