mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 13:20:31 +00:00
feat: hook up the matching form to the server
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
import { MatchingTransactionFormValues } from './types';
|
||||
|
||||
export const transformToReq = (values: MatchingTransactionFormValues) => {
|
||||
const matchedTransactions = Object.entries(values.matched)
|
||||
.filter(([key, value]) => value)
|
||||
.map(([key]) => {
|
||||
const [reference_type, reference_id] = key.split('-');
|
||||
|
||||
return { reference_type, reference_id: parseInt(reference_id, 10) };
|
||||
});
|
||||
|
||||
return { matchedTransactions };
|
||||
};
|
||||
Reference in New Issue
Block a user