Remove unused error argument

parent 3d7f860b
......@@ -31,8 +31,8 @@ export const receiveDeleteLicense = ({ commit, dispatch }, id) => {
dispatch('removePendingLicense', id);
});
};
export const receiveDeleteLicenseError = ({ commit }, error) => {
commit(types.RECEIVE_DELETE_LICENSE_ERROR, error);
export const receiveDeleteLicenseError = ({ commit }) => {
commit(types.RECEIVE_DELETE_LICENSE_ERROR);
};
export const deleteLicense = ({ dispatch, state }) => {
const licenseId = state.currentLicenseInModal.id;
......@@ -43,8 +43,8 @@ export const deleteLicense = ({ dispatch, state }) => {
.then(() => {
dispatch('receiveDeleteLicense', licenseId);
})
.catch((error) => {
dispatch('receiveDeleteLicenseError', error);
.catch(() => {
dispatch('receiveDeleteLicenseError');
dispatch('removePendingLicense', licenseId);
});
};
......@@ -110,8 +110,8 @@ export const receiveSetLicenseApproval = ({ commit, dispatch, state }, id) => {
dispatch('removePendingLicense', id);
});
};
export const receiveSetLicenseApprovalError = ({ commit }, error) => {
commit(types.RECEIVE_SET_LICENSE_APPROVAL_ERROR, error);
export const receiveSetLicenseApprovalError = ({ commit }) => {
commit(types.RECEIVE_SET_LICENSE_APPROVAL_ERROR);
};
export const fetchLicenseCheckApprovalRule = ({ dispatch, state }) => {
......@@ -188,8 +188,8 @@ export const setLicenseApproval = ({ dispatch, state }, payload) => {
.then(() => {
dispatch('receiveSetLicenseApproval', id);
})
.catch((error) => {
dispatch('receiveSetLicenseApprovalError', error);
.catch(() => {
dispatch('receiveSetLicenseApprovalError');
dispatch('removePendingLicense', id);
});
};
......
......@@ -129,12 +129,11 @@ describe('License store actions', () => {
describe('receiveDeleteLicenseError', () => {
it('commits RECEIVE_DELETE_LICENSE_ERROR', (done) => {
const error = new Error('Test');
testAction(
actions.receiveDeleteLicenseError,
error,
null,
state,
[{ type: mutationTypes.RECEIVE_DELETE_LICENSE_ERROR, payload: error }],
[{ type: mutationTypes.RECEIVE_DELETE_LICENSE_ERROR }],
[],
)
.then(done)
......@@ -171,7 +170,7 @@ describe('License store actions', () => {
return actions.deleteLicense(store).then(() => {
expectDispatched('addPendingLicense', licenseId);
expectDispatched('receiveDeleteLicenseError', expect.any(Error));
expectDispatched('receiveDeleteLicenseError');
expectDispatched('removePendingLicense', licenseId);
});
});
......@@ -205,12 +204,11 @@ describe('License store actions', () => {
describe('receiveSetLicenseApprovalError', () => {
it('commits RECEIVE_SET_LICENSE_APPROVAL_ERROR', (done) => {
const error = new Error('Test');
testAction(
actions.receiveSetLicenseApprovalError,
error,
null,
state,
[{ type: mutationTypes.RECEIVE_SET_LICENSE_APPROVAL_ERROR, payload: error }],
[{ type: mutationTypes.RECEIVE_SET_LICENSE_APPROVAL_ERROR }],
[],
)
.then(done)
......@@ -254,7 +252,7 @@ describe('License store actions', () => {
return actions.setLicenseApproval(store, { license: newLicense, newStatus }).then(() => {
expectDispatched('addPendingLicense', undefined);
expectDispatched('receiveSetLicenseApprovalError', expect.any(Error));
expectDispatched('receiveSetLicenseApprovalError');
expectDispatched('removePendingLicense', undefined);
});
});
......@@ -297,7 +295,7 @@ describe('License store actions', () => {
.setLicenseApproval(store, { license: approvedLicense, newStatus })
.then(() => {
expectDispatched('addPendingLicense', approvedLicense.id);
expectDispatched('receiveSetLicenseApprovalError', expect.any(Error));
expectDispatched('receiveSetLicenseApprovalError');
expectDispatched('removePendingLicense', approvedLicense.id);
});
});
......
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