File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed
Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,9 @@ export default class TransactionService {
1616 url += "/" + transaction . id
1717 }
1818
19- const resp = await this . client . httpPost ( url , transaction ) ;
19+ const transactionResource : TransactionResource = this . mapToResource ( transaction ) ;
20+
21+ const resp = await this . client . httpPost ( url , transactionResource ) ;
2022
2123 if ( resp . error ) {
2224 return {
@@ -48,4 +50,21 @@ export default class TransactionService {
4850 }
4951 return resource ;
5052 }
53+
54+ private mapToResource ( transaction :Transaction ) :TransactionResource {
55+ return {
56+ company_name : transaction . companyName ,
57+ company_number : transaction . companyNumber ,
58+ created_at : transaction . createdAt ,
59+ created_by : transaction . createdBy ,
60+ description : transaction . description ,
61+ etag : transaction . etag ,
62+ id : transaction . id ,
63+ kind : transaction . kind ,
64+ links : transaction . links ,
65+ reference : transaction . reference ,
66+ status : transaction . status ,
67+ updated_at : transaction . updatedAt
68+ }
69+ }
5170}
You can’t perform that action at this time.
0 commit comments