Skip to content

Commit 31f97b4

Browse files
author
gondzo
committed
add redirect on drone save/update
1 parent 373ad96 commit 31f97b4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/routes/EditDrones/modules/EditDrones.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,11 @@ export const save = (values) => async (dispatch, getState) => {
7575
drone = _.pick(drone, [..._.keys(defaultDrone), 'id']);
7676
dispatch({type: UPDATED, payload: {drone}});
7777
toastr.success('Drone saved');
78+
dispatch(push('/my-drone'));
7879
} else {
7980
drone = await APIService.createProviderDrone(drone);
80-
dispatch(push(`/edit-drones/${drone.id}`));
8181
toastr.success('Drone created');
82+
dispatch(push('/my-drone'));
8283
}
8384
};
8485

0 commit comments

Comments
 (0)