Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions apps/dashboard/src/@3rdweb-sdk/react/hooks/useApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -322,13 +322,14 @@ export type RotateSecretKeyAPIReturnType = {
};
};

export async function rotateSecretKeyClient(projectId: string) {
export async function rotateSecretKeyClient(params: {
teamId: string;
projectId: string;
}) {
const res = await apiServerProxy<RotateSecretKeyAPIReturnType>({
pathname: "/v2/keys/rotate-secret-key",
pathname: `/v1/teams/${params.teamId}/projects/${params.projectId}/rotate-secret-key`,
method: "POST",
body: JSON.stringify({
projectId,
}),
body: JSON.stringify({}),
headers: {
"Content-Type": "application/json",
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ function IntegrateAPIKeySection({
{secretKeyMasked && (
<SecretKeySection
secretKeyMasked={secretKeyMasked}
teamId={project.teamId}
projectId={project.id}
/>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { RotateSecretKeyButton } from "../../settings/ProjectGeneralSettingsPage

export function SecretKeySection(props: {
secretKeyMasked: string;
teamId: string;
projectId: string;
}) {
const [secretKeyMasked, setSecretKeyMasked] = useState(props.secretKeyMasked);
Expand All @@ -26,7 +27,10 @@ export function SecretKeySection(props: {

<RotateSecretKeyButton
rotateSecretKey={async () => {
return rotateSecretKeyClient(props.projectId);
return rotateSecretKeyClient({
teamId: props.teamId,
projectId: props.projectId,
});
}}
onSuccess={(data) => {
setSecretKeyMasked(data.data.secretMasked);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { WaitingForIntegrationCard } from "../components/WaitingForIntegrationCa

export function NebulaFTUX(props: {
secretKeyMasked: string;
teamId: string;
projectId: string;
}) {
return (
Expand Down Expand Up @@ -50,6 +51,7 @@ export function NebulaFTUX(props: {
>
<SecretKeySection
secretKeyMasked={props.secretKeyMasked}
teamId={props.teamId}
projectId={props.projectId}
/>
<div className="h-4" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export default async function Page(props: {
<div className="container mt-6 max-w-7xl">
<NebulaFTUX
secretKeyMasked={project.secretKeys[0]?.masked || ""}
teamId={team.id}
projectId={project.id}
/>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,10 @@ export function ProjectGeneralSettingsPage(props: {
}}
showNebulaSettings={props.showNebulaSettings}
rotateSecretKey={async () => {
return rotateSecretKeyClient(props.project.id);
return rotateSecretKeyClient({
teamId: props.project.teamId,
projectId: props.project.id,
});
}}
teamsWithRole={props.teamsWithRole}
transferProject={async (newTeam) => {
Expand Down
Loading