Skip to content

Commit

Permalink
Fix #356: Redirect to groups list after create/update
Browse files Browse the repository at this point in the history
  • Loading branch information
leplatrem committed Jun 3, 2019
1 parent 0325164 commit f1d398f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/sagas/bucket.js
Expand Up @@ -277,7 +277,7 @@ export function* createGroup(
data: groupData,
safe: true,
});
yield put(redirectTo("group:attributes", { bid, gid }));
yield put(redirectTo("bucket:groups", { bid }));
yield put(notifySuccess("Group created."));
} catch (error) {
yield put(notifyError("Couldn't create group.", error));
Expand Down Expand Up @@ -305,7 +305,7 @@ export function* updateGroup(
if (data) {
const updatedGroup = { ...data, id: gid, last_modified };
yield call([bucket, bucket.updateGroup], updatedGroup, { safe: true });
yield put(redirectTo("group:attributes", { bid, gid }));
yield put(redirectTo("bucket:groups", { bid }));
yield put(notifySuccess("Group attributes updated."));
} else if (permissions) {
yield call([bucket, bucket.updateGroup], loadedData, {
Expand Down
6 changes: 2 additions & 4 deletions test/sagas/bucket_test.js
Expand Up @@ -896,9 +896,8 @@ describe("bucket sagas", () => {
it("should update the route path", () => {
expect(createGroup.next().value).eql(
put(
redirectTo("group:attributes", {
redirectTo("bucket:groups", {
bid: "bucket",
gid: "group",
})
)
);
Expand Down Expand Up @@ -976,9 +975,8 @@ describe("bucket sagas", () => {
it("should update the route path", () => {
expect(updateGroup.next().value).eql(
put(
redirectTo("group:attributes", {
redirectTo("bucket:groups", {
bid: "bucket",
gid: "group",
})
)
);
Expand Down

0 comments on commit f1d398f

Please sign in to comment.