diff --git a/front/lib/api/data_sources.ts b/front/lib/api/data_sources.ts index 597aba0c83b8..847f6b5b5344 100644 --- a/front/lib/api/data_sources.ts +++ b/front/lib/api/data_sources.ts @@ -823,6 +823,14 @@ export async function createDataSourceWithoutProvider( }); } + if (dataSources.some((ds) => ds.name === name)) { + return new Err({ + name: "dust_error", + code: "invalid_request_error", + message: "Data source with that name already exist.", + }); + } + const dataSourceEmbedder = owner.defaultEmbeddingProvider ?? DEFAULT_EMBEDDING_PROVIDER_ID; const embedderConfig = EMBEDDING_CONFIGS[dataSourceEmbedder];