mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-06-28 21:49:40 +02:00
fix: fix backward compatibility in luma connector page
This commit is contained in:
parent
5984696b7e
commit
1c197f8f57
1 changed files with 8 additions and 4 deletions
|
|
@ -33,6 +33,7 @@ import {
|
||||||
import { Input } from "@/components/ui/input";
|
import { Input } from "@/components/ui/input";
|
||||||
import { EnumConnectorName } from "@/contracts/enums/connector";
|
import { EnumConnectorName } from "@/contracts/enums/connector";
|
||||||
import { getConnectorIcon } from "@/contracts/enums/connectorIcons";
|
import { getConnectorIcon } from "@/contracts/enums/connectorIcons";
|
||||||
|
import { SearchSourceConnector } from "@/contracts/types/connector.types";
|
||||||
|
|
||||||
// Define the form schema with Zod
|
// Define the form schema with Zod
|
||||||
const lumaConnectorFormSchema = z.object({
|
const lumaConnectorFormSchema = z.object({
|
||||||
|
|
@ -66,16 +67,19 @@ export default function LumaConnectorPage() {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const { refetch : fetchConnectors } = useAtomValue(connectorsAtom);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (connectors) {
|
fetchConnectors().then((data) => {
|
||||||
|
const connectors = data.data || [];
|
||||||
const connector = connectors.find(
|
const connector = connectors.find(
|
||||||
(c) => c.connector_type === EnumConnectorName.LUMA_CONNECTOR
|
(c: SearchSourceConnector) => c.connector_type === EnumConnectorName.LUMA_CONNECTOR
|
||||||
);
|
);
|
||||||
if (connector) {
|
if (connector) {
|
||||||
setDoesConnectorExist(true);
|
setDoesConnectorExist(true);
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
}, [connectors]);
|
}, []);
|
||||||
|
|
||||||
// Handle form submission
|
// Handle form submission
|
||||||
const onSubmit = async (values: LumaConnectorFormValues) => {
|
const onSubmit = async (values: LumaConnectorFormValues) => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue