File tree 6 files changed +21
-12
lines changed
app/(app)/team/[team_slug]/[project_slug]
6 files changed +21
-12
lines changed Original file line number Diff line number Diff line change @@ -322,13 +322,14 @@ export type RotateSecretKeyAPIReturnType = {
322
322
} ;
323
323
} ;
324
324
325
- export async function rotateSecretKeyClient ( projectId : string ) {
325
+ export async function rotateSecretKeyClient ( params : {
326
+ teamId : string ;
327
+ projectId : string ;
328
+ } ) {
326
329
const res = await apiServerProxy < RotateSecretKeyAPIReturnType > ( {
327
- pathname : "/v2/keys/ rotate-secret-key" ,
330
+ pathname : `/v1/teams/ ${ params . teamId } /projects/ ${ params . projectId } / rotate-secret-key` ,
328
331
method : "POST" ,
329
- body : JSON . stringify ( {
330
- projectId,
331
- } ) ,
332
+ body : JSON . stringify ( { } ) ,
332
333
headers : {
333
334
"Content-Type" : "application/json" ,
334
335
} ,
Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ function IntegrateAPIKeySection({
63
63
{ secretKeyMasked && (
64
64
< SecretKeySection
65
65
secretKeyMasked = { secretKeyMasked }
66
- projectId = { project . id }
66
+ project = { project }
67
67
/>
68
68
) }
69
69
</ div >
Original file line number Diff line number Diff line change 1
1
"use client" ;
2
2
3
+ import type { Project } from "@/api/projects" ;
3
4
import { rotateSecretKeyClient } from "@3rdweb-sdk/react/hooks/useApi" ;
4
5
import { useState } from "react" ;
5
6
import { RotateSecretKeyButton } from "../../settings/ProjectGeneralSettingsPage" ;
6
7
7
8
export function SecretKeySection ( props : {
8
9
secretKeyMasked : string ;
9
- projectId : string ;
10
+ project : Project ;
10
11
} ) {
11
12
const [ secretKeyMasked , setSecretKeyMasked ] = useState ( props . secretKeyMasked ) ;
12
13
@@ -26,7 +27,10 @@ export function SecretKeySection(props: {
26
27
27
28
< RotateSecretKeyButton
28
29
rotateSecretKey = { async ( ) => {
29
- return rotateSecretKeyClient ( props . projectId ) ;
30
+ return rotateSecretKeyClient ( {
31
+ teamId : props . project . teamId ,
32
+ projectId : props . project . id ,
33
+ } ) ;
30
34
} }
31
35
onSuccess = { ( data ) => {
32
36
setSecretKeyMasked ( data . data . secretMasked ) ;
Original file line number Diff line number Diff line change
1
+ import type { Project } from "@/api/projects" ;
1
2
import { CodeServer } from "@/components/ui/code/code.server" ;
2
3
import { SecretKeySection } from "../components/ProjectFTUX/SecretKeySection" ;
3
4
import { WaitingForIntegrationCard } from "../components/WaitingForIntegrationCard/WaitingForIntegrationCard" ;
4
5
5
6
export function NebulaFTUX ( props : {
6
7
secretKeyMasked : string ;
7
- projectId : string ;
8
+ project : Project ;
8
9
} ) {
9
10
return (
10
11
< WaitingForIntegrationCard
@@ -50,7 +51,7 @@ export function NebulaFTUX(props: {
50
51
>
51
52
< SecretKeySection
52
53
secretKeyMasked = { props . secretKeyMasked }
53
- projectId = { props . projectId }
54
+ project = { props . project }
54
55
/>
55
56
< div className = "h-4" />
56
57
</ WaitingForIntegrationCard >
Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ export default async function Page(props: {
60
60
< div className = "container mt-6 max-w-7xl" >
61
61
< NebulaFTUX
62
62
secretKeyMasked = { project . secretKeys [ 0 ] ?. masked || "" }
63
- projectId = { project . id }
63
+ project = { project }
64
64
/>
65
65
</ div >
66
66
</ div >
Original file line number Diff line number Diff line change @@ -165,7 +165,10 @@ export function ProjectGeneralSettingsPage(props: {
165
165
} }
166
166
showNebulaSettings = { props . showNebulaSettings }
167
167
rotateSecretKey = { async ( ) => {
168
- return rotateSecretKeyClient ( props . project . id ) ;
168
+ return rotateSecretKeyClient ( {
169
+ teamId : props . project . teamId ,
170
+ projectId : props . project . id ,
171
+ } ) ;
169
172
} }
170
173
teamsWithRole = { props . teamsWithRole }
171
174
transferProject = { async ( newTeam ) => {
You can’t perform that action at this time.
0 commit comments