Merge branch '17114-side-panel-tree-as-list'
[arvados-workbench2.git] / src / store / collections / collection-move-actions.ts
index dc73e5a515bdc9d07d34b1361ba656d98380ab6c..a64a7a1d699db5d973f0332565daeac441836246 100644 (file)
@@ -30,15 +30,14 @@ export const moveCollection = (resource: MoveToFormDialogData) =>
         dispatch(startSubmit(COLLECTION_MOVE_FORM_NAME));
         try {
             dispatch(progressIndicatorActions.START_WORKING(COLLECTION_MOVE_FORM_NAME));
-            const collection = await services.collectionService.get(resource.uuid);
-            await services.collectionService.update(resource.uuid, { ...collection, ownerUuid: resource.ownerUuid });
+            const collection = await services.collectionService.update(resource.uuid, { ownerUuid: resource.ownerUuid });
             dispatch(projectPanelActions.REQUEST_ITEMS());
             dispatch(dialogActions.CLOSE_DIALOG({ id: COLLECTION_MOVE_FORM_NAME }));
             dispatch(progressIndicatorActions.STOP_WORKING(COLLECTION_MOVE_FORM_NAME));
             return collection;
         } catch (e) {
             const error = getCommonResourceServiceError(e);
-            if (error === CommonResourceServiceError.UNIQUE_VIOLATION) {
+            if (error === CommonResourceServiceError.UNIQUE_NAME_VIOLATION) {
                 dispatch(stopSubmit(COLLECTION_MOVE_FORM_NAME, { ownerUuid: 'A collection with the same name already exists in the target project.' } as FormErrors));
             } else {
                 dispatch(dialogActions.CLOSE_DIALOG({ id: COLLECTION_MOVE_FORM_NAME }));