mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 05:40:31 +00:00
fix: conflict merge.
This commit is contained in:
@@ -19,21 +19,21 @@ export const fetchBillsTable = ({ query = {} }) => {
|
||||
dispatch({
|
||||
type: t.BILLS_PAGE_SET,
|
||||
payload: {
|
||||
bills: response.data.bills.results,
|
||||
pagination: response.data.bills.pagination,
|
||||
bills: response.data.bills,
|
||||
pagination: response.data.pagination,
|
||||
customViewId: response.data.customViewId || -1,
|
||||
},
|
||||
});
|
||||
dispatch({
|
||||
type: t.BILLS_ITEMS_SET,
|
||||
payload: {
|
||||
bills: response.data.bills.results,
|
||||
bills: response.data.bills,
|
||||
},
|
||||
});
|
||||
dispatch({
|
||||
type: t.BILLS_PAGINATION_SET,
|
||||
payload: {
|
||||
pagination: response.data.bills.pagination,
|
||||
pagination: response.data.pagination,
|
||||
customViewId: response.data.customViewId || -1,
|
||||
},
|
||||
});
|
||||
@@ -66,7 +66,19 @@ export const deleteBill = ({ id }) => {
|
||||
};
|
||||
|
||||
export const submitBill = ({ form }) => {
|
||||
return (dispatch) => ApiService.post('purchases/bills', form);
|
||||
return (dispatch) =>
|
||||
new Promise((resolve, reject) => {
|
||||
ApiService.post('purchases/bills', form)
|
||||
.then((response) => {
|
||||
resolve(response);
|
||||
})
|
||||
.catch((error) => {
|
||||
const { response } = error;
|
||||
const { data } = response;
|
||||
|
||||
reject(data?.errors);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
export const fetchBill = ({ id }) => {
|
||||
@@ -91,5 +103,17 @@ export const fetchBill = ({ id }) => {
|
||||
};
|
||||
|
||||
export const editBill = (id, form) => {
|
||||
return (dispatch) => ApiService.post(`purchases/bills/${id}`, form);
|
||||
return (dispatch) =>
|
||||
new Promise((resolve, reject) => {
|
||||
ApiService.post(`purchases/bills/${id}`, form)
|
||||
.then((response) => {
|
||||
resolve(response);
|
||||
})
|
||||
.catch((error) => {
|
||||
const { response } = error;
|
||||
const { data } = response;
|
||||
|
||||
reject(data?.errors);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
@@ -12,6 +12,7 @@ const initialState = {
|
||||
page_size: 5,
|
||||
page: 1,
|
||||
},
|
||||
nextBillNumberChanged: false,
|
||||
};
|
||||
|
||||
const defaultBill = {
|
||||
@@ -98,6 +99,11 @@ const reducer = createReducer(initialState, {
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
[t.BILL_NUMBER_CHANGED]: (state, action) => {
|
||||
const { isChanged } = action.payload;
|
||||
state.nextBillNumberChanged = isChanged;
|
||||
},
|
||||
});
|
||||
|
||||
export default createTableQueryReducers('bills', reducer);
|
||||
|
||||
@@ -9,4 +9,5 @@ export default {
|
||||
BILLS_PAGINATION_SET: 'BILLS_PAGINATION_SET',
|
||||
BILLS_PAGE_SET: 'BILLS_PAGE_SET',
|
||||
BILLS_ITEMS_SET: 'BILLS_ITEMS_SET',
|
||||
BILL_NUMBER_CHANGED: 'BILL_NUMBER_CHANGED',
|
||||
};
|
||||
|
||||
2
client/src/store/vendors/vendors.actions.js
vendored
2
client/src/store/vendors/vendors.actions.js
vendored
@@ -17,7 +17,7 @@ export const fetchVendorsTable = ({ query }) => {
|
||||
payload: {
|
||||
vendors: response.data.vendors,
|
||||
pagination: response.data.pagination,
|
||||
customViewId: response.data.customViewId,
|
||||
customViewId: response.data.customViewId || -1,
|
||||
},
|
||||
});
|
||||
dispatch({
|
||||
|
||||
Reference in New Issue
Block a user