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