mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-20 06:40:31 +00:00
WIP feature/Bulk
This commit is contained in:
@@ -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) => {
|
||||
|
||||
@@ -20,5 +20,8 @@ export default {
|
||||
|
||||
ACCOUNT_ERRORS_SET: 'ACCOUNT_ERRORS_SET',
|
||||
ACCOUNT_ERRORS_CLEAR: 'ACCOUNT_ERRORS_CLEAR',
|
||||
ACCOUNTS_BULK_DELETE: 'ACCOUNTS_BULK_DELETE'
|
||||
ACCOUNTS_BULK_DELETE: 'ACCOUNTS_BULK_DELETE',
|
||||
BULK_ACTIVATE_ACCOUNTS:'BULK_ACTIVATE_ACCOUNTS',
|
||||
BULK_INACTIVATE_ACCOUNTS:'BULK_INACTIVATE_ACCOUNTS'
|
||||
|
||||
};
|
||||
Reference in New Issue
Block a user