15856: Enhances error constant naming.
[arvados-workbench2.git] / src / store / collections / collection-create-actions.ts
index 8d1e9ba5f247be426fc0b2faabb6d4ec60f858fb..a9534c6bb132c18a811a991285574a18ab9f88dc 100644 (file)
@@ -51,7 +51,7 @@ export const createCollection = (data: CollectionCreateFormDialogData) =>
             return newCollection;
         } catch (e) {
             const error = getCommonResourceServiceError(e);
-            if (error === CommonResourceServiceError.UNIQUE_VIOLATION) {
+            if (error === CommonResourceServiceError.UNIQUE_NAME_VIOLATION) {
                 dispatch(stopSubmit(COLLECTION_CREATE_FORM_NAME, { name: 'Collection with the same name already exists.' } as FormErrors));
             } else if (error === CommonResourceServiceError.NONE) {
                 dispatch(stopSubmit(COLLECTION_CREATE_FORM_NAME));