feat: Items data table.

This commit is contained in:
Ahmed Bouhuolia
2020-03-25 18:05:15 +02:00
parent 1894ad3b18
commit edd8693450
22 changed files with 567 additions and 20 deletions

View File

@@ -11,10 +11,16 @@ export const editItem = ({ id, form }) => {
export const fetchItems = ({ query }) => {
return (dispatch) => new Promise((resolve, reject) => {
ApiService.get(`items`, query).then(response => {
ApiService.get(`items`).then(response => {
dispatch({
type: t.ITEMS_LIST_SET,
items: response.data.items,
type: t.ITEMS_SET,
items: response.data.items.results,
});
dispatch({
type: t.ITEMS_PAGE_SET,
items: response.data.items.results,
customViewId: response.data.customViewId,
paginationMeta: response.data.items.pagination,
});
resolve(response);
}).catch(error => { reject(error); });