mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
Removing redundancies in Woo-Commerce node. (#596)
* Iterating additionalFields given instead of hard coding the interface to match them when creating a product * Removed redundancy for product creation/update and order create. Co-authored-by: Omar Ajoue <krynble@gmail.com>
This commit is contained in:
@@ -149,6 +149,12 @@ export function toSnakeCase(data:
|
||||
}
|
||||
}
|
||||
|
||||
export function setFields(fieldsToSet: IDataObject, body: any) {
|
||||
for(let fields in fieldsToSet) {
|
||||
body[snakeCase(fields.toString())] = fieldsToSet[fields]
|
||||
}
|
||||
}
|
||||
|
||||
export function adjustMetadata(fields: IDataObject & Metadata) {
|
||||
if (!fields.meta_data) return fields;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user