Remove unused error argument

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