Fix creation of a new view duplicating existing filters (#9240)

Fixes #9239
This commit is contained in:
Marie
2024-12-26 11:43:05 +01:00
committed by GitHub
parent f63b0a235a
commit 2da3d83a41
2 changed files with 8 additions and 2 deletions

View File

@ -17,6 +17,7 @@ import {
TimeoutError,
UserInputError,
} from 'src/engine/core-modules/graphql/utils/graphql-errors.util';
import { isDefined } from 'src/utils/is-defined';
export const workspaceQueryRunnerGraphqlApiExceptionHandler = (
error: Error,
@ -49,7 +50,11 @@ export const workspaceQueryRunnerGraphqlApiExceptionHandler = (
return fieldMetadata?.label;
});
const columnNames = affectedColumns?.join(', ');
if (!isDefined(affectedColumns)) {
throw new UserInputError(`A duplicate entry was detected`);
}
const columnNames = affectedColumns.join(', ');
if (affectedColumns?.length === 1) {
throw new UserInputError(