WIP feature/Bulk

This commit is contained in:
elforjani3
2020-05-20 01:49:36 +02:00
parent 10f636d2bc
commit 3753c3e791
20 changed files with 454 additions and 73 deletions

View File

@@ -185,6 +185,39 @@ export const inactiveAccount = ({ id }) => {
return dispatch => ApiService.post(`accounts/${id}/inactive`);
};
export const bulkActivateAccounts =({ids})=>{
return dispatch => new Promise((resolve, reject) => {
ApiService.post(`accounts/bulk/activate`, null, { params: { ids }}).then((response) => {
dispatch({
type: t.BULK_ACTIVATE_ACCOUNTS,
payload: { ids }
});
resolve(response);
}).catch((error) => {
reject(error);
});
});
}
export const bulkInactiveAccounts =({ids})=>{
return dispatch => new Promise((resolve, reject) => {
ApiService.post(`accounts/bulk/inactivate`, null, { params: { ids }}).then((response) => {
dispatch({
type: t.BULK_INACTIVATE_ACCOUNTS,
payload: { ids }
});
resolve(response);
}).catch((error) => {
reject(error);
});
});
}
export const deleteAccount = ({ id }) => {
return dispatch => new Promise((resolve, reject) => {
ApiService.delete(`accounts/${id}`).then((response) => {