mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-10-01 08:54:59 +02:00
Fix deletion of web/slack/jira/confluence/... connector when creating a new one
This commit is contained in:
@@ -80,12 +80,14 @@ export function ConnectorForm<T extends Yup.AnyObject>({
|
|||||||
validationSchema={validationSchema}
|
validationSchema={validationSchema}
|
||||||
onSubmit={async (values, formikHelpers) => {
|
onSubmit={async (values, formikHelpers) => {
|
||||||
formikHelpers.setSubmitting(true);
|
formikHelpers.setSubmitting(true);
|
||||||
|
const connectorName = nameBuilder(values);
|
||||||
|
|
||||||
// best effort check to see if existing connector exists
|
// best effort check to see if existing connector exists
|
||||||
// delete it if it does, the current assumption is that only
|
// delete it if it does, the current assumption is that only
|
||||||
// one google drive connector will exist at a time
|
// one google drive connector will exist at a time
|
||||||
const errorMsg = await deleteConnectorIfExists({
|
const errorMsg = await deleteConnectorIfExists({
|
||||||
source,
|
source,
|
||||||
|
name: connectorName,
|
||||||
});
|
});
|
||||||
if (errorMsg) {
|
if (errorMsg) {
|
||||||
setPopup({
|
setPopup({
|
||||||
@@ -96,7 +98,7 @@ export function ConnectorForm<T extends Yup.AnyObject>({
|
|||||||
}
|
}
|
||||||
|
|
||||||
const { message, isSuccess, response } = await submitConnector<T>({
|
const { message, isSuccess, response } = await submitConnector<T>({
|
||||||
name: nameBuilder(values),
|
name: connectorName,
|
||||||
source,
|
source,
|
||||||
input_type: inputType,
|
input_type: inputType,
|
||||||
connector_specific_config: values,
|
connector_specific_config: values,
|
||||||
|
Reference in New Issue
Block a user