mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-01-25 02:08:11 +00:00
36 lines
1.0 KiB
TypeScript
36 lines
1.0 KiB
TypeScript
"use client";
|
|
|
|
import { updateCredentialsProvider } from "@/actions/providers/providers";
|
|
import { ProviderType } from "@/types";
|
|
|
|
import { BaseCredentialsForm } from "./base-credentials-form";
|
|
|
|
export const UpdateViaRoleForm = ({
|
|
searchParams,
|
|
providerUid,
|
|
}: {
|
|
searchParams: { type: string; id: string; secretId?: string };
|
|
providerUid?: string;
|
|
}) => {
|
|
const providerType = searchParams.type as ProviderType;
|
|
const providerId = searchParams.id;
|
|
const providerSecretId = searchParams.secretId || "";
|
|
|
|
const handleUpdateCredentials = async (formData: FormData) => {
|
|
return await updateCredentialsProvider(providerSecretId, formData);
|
|
};
|
|
|
|
const successNavigationUrl = `/providers/test-connection?type=${providerType}&id=${providerId}&updated=true`;
|
|
|
|
return (
|
|
<BaseCredentialsForm
|
|
providerType={providerType}
|
|
providerId={providerId}
|
|
providerUid={providerUid}
|
|
onSubmit={handleUpdateCredentials}
|
|
successNavigationUrl={successNavigationUrl}
|
|
submitButtonText="Next"
|
|
/>
|
|
);
|
|
};
|