File tree Expand file tree Collapse file tree 2 files changed +4
-6
lines changed
Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Original file line number Diff line number Diff line change 11import chargebee from "../../chargebee.app.mjs" ;
2+ import { clearObject } from "../../common/utils.mjs" ;
23
34export default {
45 key : "chargebee-create-customer" ,
@@ -52,18 +53,15 @@ export default {
5253 } ,
5354 } ,
5455 async run ( { $ } ) {
55- const response = await this . chargebee . createCustomer ( Object . fromEntries ( Object . entries ( {
56+ const response = await this . chargebee . createCustomer ( clearObject ( {
5657 id : this . id ,
5758 first_name : this . firstName ,
5859 last_name : this . lastName ,
5960 email : this . email ,
6061 phone : this . phone ,
6162 company : this . company ,
6263 ...this . additionalFields ,
63- } ) . filter ( ( [
64- _ ,
65- v ,
66- ] ) => v !== undefined ) ) ) ;
64+ } ) ) ;
6765
6866 $ . export ( "$summary" , `Successfully created customer (ID: ${ response ?. customer ?. id } )` ) ;
6967 return response ;
Original file line number Diff line number Diff line change 11export function clearObject ( obj ) {
22 return Object . fromEntries ( Object . entries ( obj ) . filter ( ( [
3- _ ,
3+ ,
44 v ,
55 ] ) => v !== undefined ) ) ;
66}
You can’t perform that action at this time.
0 commit comments