mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 14:20:31 +00:00
WIP feature/Bulk delete items
This commit is contained in:
@@ -76,3 +76,19 @@ export const deleteItem = ({ id }) => {
|
||||
}).catch((error) => { reject(error); });
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
export const deleteBulkItems = ({ ids }) => {
|
||||
return dispatch => new Promise((resolve, reject) => {
|
||||
ApiService.delete(`items`, { params: { ids }}).then((response) => {
|
||||
dispatch({
|
||||
type: t.ITEMS_BULK_DELETE,
|
||||
payload: { ids }
|
||||
});
|
||||
resolve(response);
|
||||
}).catch((error) => {
|
||||
reject(error);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
@@ -12,4 +12,6 @@ export default {
|
||||
|
||||
ITEMS_TABLE_LOADING: 'ITEMS_TABLE_LOADING',
|
||||
ITEMS_SET_CURRENT_VIEW: 'ITEMS_SET_CURRENT_VIEW',
|
||||
ITEMS_BULK_DELETE:'ITEMS_BULK_DELETE'
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user