mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-07-23 20:42:02 +00:00
chore: remove connected param in the last step
This commit is contained in:
@@ -1,7 +1,3 @@
|
||||
### Motivation
|
||||
|
||||
Why it this PR useful for the project?
|
||||
|
||||
### Description
|
||||
|
||||
What was done in this PR
|
||||
|
||||
@@ -5,12 +5,11 @@ import { getProvider } from "@/actions/providers";
|
||||
import { LaunchScanForm } from "@/components/providers/workflow/forms";
|
||||
|
||||
interface Props {
|
||||
searchParams: { type: string; id: string; connected: boolean };
|
||||
searchParams: { type: string; id: string };
|
||||
}
|
||||
|
||||
export default async function LaunchScanPage({ searchParams }: Props) {
|
||||
const providerId = searchParams.id;
|
||||
const connectedSearchParam = searchParams.connected;
|
||||
|
||||
if (!providerId) {
|
||||
redirect("/providers/connect-account");
|
||||
@@ -23,7 +22,7 @@ export default async function LaunchScanPage({ searchParams }: Props) {
|
||||
|
||||
const isConnected = providerData?.data?.attributes?.connection?.connected;
|
||||
|
||||
if (!isConnected || connectedSearchParam !== isConnected.toString()) {
|
||||
if (!isConnected) {
|
||||
redirect("/providers/connect-account");
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ import { ProviderInfo } from "../../provider-info";
|
||||
type FormValues = z.infer<ReturnType<typeof launchScanFormSchema>>;
|
||||
|
||||
interface LaunchScanFormProps {
|
||||
searchParams: { type: string; id: string; connected: boolean };
|
||||
searchParams: { type: string; id: string };
|
||||
providerData: {
|
||||
data: {
|
||||
type: string;
|
||||
@@ -32,7 +32,6 @@ export const LaunchScanForm = ({
|
||||
}: LaunchScanFormProps) => {
|
||||
const providerType = searchParams.type;
|
||||
const providerId = searchParams.id;
|
||||
const connected = searchParams.connected;
|
||||
|
||||
// const [apiErrorMessage, setApiErrorMessage] = useState<string | null>(null);
|
||||
|
||||
@@ -53,10 +52,12 @@ export const LaunchScanForm = ({
|
||||
|
||||
const isLoading = form.formState.isSubmitting;
|
||||
|
||||
const isConnected = providerData.data.attributes.connection.connected;
|
||||
|
||||
const onSubmitClient = async (values: FormValues) => {
|
||||
console.log({ values }, "values from test connection form");
|
||||
|
||||
if (connected) {
|
||||
if (isConnected) {
|
||||
console.log("connected");
|
||||
} else {
|
||||
console.log("not connected");
|
||||
|
||||
@@ -85,7 +85,7 @@ export const TestConnectionForm = ({
|
||||
|
||||
if (connected) {
|
||||
router.push(
|
||||
`/providers/launch-scan?type=${providerType}&id=${providerId}&connected=${connected}`,
|
||||
`/providers/launch-scan?type=${providerType}&id=${providerId}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user