Skip to content

Commit a29aeba

Browse files
committed
fix
1 parent 144a4ee commit a29aeba

File tree

5 files changed

+9
-35
lines changed

5 files changed

+9
-35
lines changed

src/pages/Dashboard/NewInstance.tsx

Lines changed: 5 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { zodResolver } from "@hookform/resolvers/zod";
22
import { PlusIcon } from "lucide-react";
3-
import { useEffect, useState } from "react";
3+
import { useState } from "react";
44
import { useForm, FormProvider } from "react-hook-form";
55
import { useTranslation } from "react-i18next";
66
import { toast } from "react-toastify";
@@ -33,19 +33,13 @@ const FormSchema = z.object({
3333
token: stringOrUndefined,
3434
number: stringOrUndefined,
3535
businessId: stringOrUndefined,
36-
integration: z.enum([
37-
"WHATSAPP-BUSINESS",
38-
"WHATSAPP-BAILEYS",
39-
"META-FACEBOOK",
40-
"META-INSTAGRAM",
41-
"EVOLUTION",
42-
]),
36+
integration: z.enum(["WHATSAPP-BUSINESS", "WHATSAPP-BAILEYS", "EVOLUTION"]),
4337
});
4438

4539
function NewInstance({ resetTable }: { resetTable: () => void }) {
4640
const { t } = useTranslation();
4741
const [open, setOpen] = useState(false);
48-
const [options, setOptions] = useState([
42+
const options = [
4943
{
5044
value: "WHATSAPP-BAILEYS",
5145
label: t("instance.form.integration.baileys"),
@@ -58,7 +52,8 @@ function NewInstance({ resetTable }: { resetTable: () => void }) {
5852
value: "EVOLUTION",
5953
label: t("instance.form.integration.evolution"),
6054
},
61-
]);
55+
];
56+
6257
const form = useForm<z.infer<typeof FormSchema>>({
6358
resolver: zodResolver(FormSchema),
6459
defaultValues: {
@@ -70,27 +65,6 @@ function NewInstance({ resetTable }: { resetTable: () => void }) {
7065
},
7166
});
7267

73-
const facebookLogin =
74-
localStorage.getItem("facebookUserToken") &&
75-
localStorage.getItem("facebookConfigId") &&
76-
localStorage.getItem("facebookAppId");
77-
78-
useEffect(() => {
79-
if (facebookLogin) {
80-
setOptions([
81-
...options,
82-
{
83-
value: "META-FACEBOOK",
84-
label: t("instance.form.integration.facebook"),
85-
},
86-
{
87-
value: "META-INSTAGRAM",
88-
label: t("instance.form.integration.instagram"),
89-
},
90-
]);
91-
}
92-
}, [facebookLogin]);
93-
9468
const integrationSelected = form.watch("integration");
9569

9670
const onSubmit = async (data: z.infer<typeof FormSchema>) => {

src/pages/instance/Flowise/UpdateFlowise.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ function UpdateFlowise({ flowiseId, resetTable }: UpdateFlowiseProps) {
122122

123123
setOpenDeletionDialog(false);
124124
resetTable();
125-
navigate(`/manager/instance/${instance.id}/dify`);
125+
navigate(`/manager/instance/${instance.id}/flowise`);
126126
} else {
127127
console.error("instance not found");
128128
}

src/pages/instance/Openai/UpdateOpenai.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ function UpdateOpenai({ openaiId, resetTable }: UpdateOpenaiProps) {
143143

144144
setOpenDeletionDialog(false);
145145
resetTable();
146-
navigate(`/manager/instance/${instance.id}/dify`);
146+
navigate(`/manager/instance/${instance.id}/openai`);
147147
} else {
148148
console.error("instance not found");
149149
}

src/pages/instance/Typebot/TypebotForm.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ function TypebotForm({
111111
<Input />
112112
</FormInput>
113113
<FormInput name="typebot" label={t("typebot.form.typebot.label")}>
114-
<Input type="password" />
114+
<Input />
115115
</FormInput>
116116

117117
<div className="flex flex-col">

src/pages/instance/Typebot/UpdateTypebot.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ function UpdateTypebot({ typebotId, resetTable }: UpdateTypebotProps) {
122122

123123
setOpenDeletionDialog(false);
124124
resetTable();
125-
navigate(`/manager/instance/${instance.id}/dify`);
125+
navigate(`/manager/instance/${instance.id}/typebot`);
126126
} else {
127127
console.error("instance not found");
128128
}

0 commit comments

Comments
 (0)