+ ).then(updatedCollection => {
+ updatedCollection = {...cachedCollection, ...updatedCollection};
+ dispatch(collectionPanelActions.SET_COLLECTION(updatedCollection));
+ dispatch(resourcesActions.SET_RESOURCES([updatedCollection]));
+ dispatch(snackbarActions.OPEN_SNACKBAR({
+ message: "Property has been successfully added.",
+ hideDuration: 2000,
+ kind: SnackbarKind.SUCCESS }));
+ dispatch<any>(loadDetailsPanel(updatedCollection.uuid));
+ return updatedCollection;
+ }).catch (e =>
+ dispatch(snackbarActions.OPEN_SNACKBAR({
+ message: e.errors[0],
+ hideDuration: 2000,
+ kind: SnackbarKind.ERROR }))
+ );
+ };
+
+export const navigateToProcess = (uuid: string) =>
+ async (dispatch: Dispatch<any>, getState: () => RootState, services: ServiceRepository) => {
+ try {
+ await services.containerRequestService.get(uuid);
+ dispatch<any>(navigateTo(uuid));
+ } catch {
+ dispatch(snackbarActions.OPEN_SNACKBAR({ message: 'This process does not exist!', hideDuration: 2000, kind: SnackbarKind.ERROR }));