Lines 114-126
export default {
Link Here
|
114 |
delete vendor.physical; |
114 |
delete vendor.physical; |
115 |
delete vendor.subscriptions_count; |
115 |
delete vendor.subscriptions_count; |
116 |
|
116 |
|
117 |
vendor.contacts = vendor.contacts.map( |
117 |
vendor.contacts = this.checkContactOrInterface( |
118 |
({ id, booksellerid, ...requiredProperties }) => |
118 |
vendor.contacts.map( |
119 |
requiredProperties |
119 |
({ id, booksellerid, ...requiredProperties }) => |
|
|
120 |
requiredProperties |
121 |
) |
120 |
); |
122 |
); |
121 |
vendor.interfaces = vendor.interfaces.map( |
123 |
vendor.interfaces = this.checkContactOrInterface( |
122 |
({ interface_id, vendor_id, ...requiredProperties }) => |
124 |
vendor.interfaces.map( |
123 |
requiredProperties |
125 |
({ interface_id, vendor_id, ...requiredProperties }) => |
|
|
126 |
requiredProperties |
127 |
) |
124 |
); |
128 |
); |
125 |
|
129 |
|
126 |
const client = APIClient.acquisition; |
130 |
const client = APIClient.acquisition; |
Lines 142-147
export default {
Link Here
|
142 |
); |
146 |
); |
143 |
} |
147 |
} |
144 |
}, |
148 |
}, |
|
|
149 |
checkContactOrInterface(array) { |
150 |
return array.reduce((acc, curr) => { |
151 |
const atLeastOneFieldFilled = Object.keys(curr).some( |
152 |
key => curr[key] |
153 |
); |
154 |
if (atLeastOneFieldFilled) { |
155 |
acc.push(curr); |
156 |
} |
157 |
return acc; |
158 |
}, []); |
159 |
}, |
145 |
}, |
160 |
}, |
146 |
components: { |
161 |
components: { |
147 |
ButtonSubmit, |
162 |
ButtonSubmit, |