15856: Enhances error constant naming.
[arvados-workbench2.git] / src / store / groups-panel / groups-panel-actions.ts
index af48b25b3878e838bd95002441ffcddb00e2f5df..cfd8438cbde246b45b79c89005b908770210f3e1 100644 (file)
@@ -101,7 +101,7 @@ export const createGroup = ({ name, users = [] }: CreateGroupFormData) =>
         } catch (e) {
 
             const error = getCommonResourceServiceError(e);
-            if (error === CommonResourceServiceError.UNIQUE_VIOLATION) {
+            if (error === CommonResourceServiceError.UNIQUE_NAME_VIOLATION) {
                 dispatch(stopSubmit(CREATE_GROUP_FORM, { name: 'Group with the same name already exists.' } as FormErrors));
             }
 
@@ -118,9 +118,9 @@ interface AddGroupMemberArgs {
 }
 
 /**
- * Group membership is determined by whether the group has can_read permission on an object. 
+ * Group membership is determined by whether the group has can_read permission on an object.
  * If a group G can_read an object A, then we say A is a member of G.
- * 
+ *
  * [Permission model docs](https://doc.arvados.org/api/permission-model.html)
  */
 export const addGroupMember = async ({ user, group, ...args }: AddGroupMemberArgs) => {