Commit 71ef42f4 authored by Andrew Fontaine's avatar Andrew Fontaine

Pass the iid of the User List on Update

The IID is needed to calculate the API endpoint to request when
updating the user list.
parent d76b63ea
......@@ -14,6 +14,7 @@ export const dismissErrorAlert = ({ commit }) => commit(types.DISMISS_ERROR_ALER
export const updateUserList = ({ commit, state }, userList) => {
return Api.updateFeatureFlagUserList(state.projectId, {
iid: userList.iid,
name: userList.name,
})
.then(({ data }) => redirectTo(data.path))
......
---
title: Pass the IID of the User List on Update
merge_request: 39639
author:
type: fixed
......@@ -111,6 +111,7 @@ describe('ee/user_lists/components/edit_user_list', () => {
it('should create a user list with the entered name', () => {
expect(Api.updateFeatureFlagUserList).toHaveBeenCalledWith('1', {
name: 'test',
iid: userList.iid,
});
});
......
......@@ -87,6 +87,7 @@ describe('User Lists Edit Actions', () => {
return testAction(actions.updateUserList, updatedList, state, [], [], () => {
expect(Api.updateFeatureFlagUserList).toHaveBeenCalledWith('1', {
name: updatedList.name,
iid: updatedList.iid,
});
expect(redirectTo).toHaveBeenCalledWith(userList.path);
});
......@@ -111,6 +112,7 @@ describe('User Lists Edit Actions', () => {
() =>
expect(Api.updateFeatureFlagUserList).toHaveBeenCalledWith('1', {
name: updatedList.name,
iid: updatedList.iid,
}),
);
});
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment