function update_fields_with_new_ids(fields, field_db_ids) {
	return fields.map((field) => ({
		...field,
		id: field_db_ids[field.id] || field.id,
		parent: field_db_ids[field.parent] || field.parent
	}))
}
Updates fields with new IDs.

This function takes an array of field objects and updates their IDs and parent IDs
based on the provided mapping object. It's useful for synchronizing field data with database IDs
after operations that may have changed these IDs.

@param {Array<Object>} fields - The array of field objects to update.
@param {Object<string, string> | Object} field_db_ids - An object mapping original field IDs to database IDs.
@returns {Array<Object>} The updated array of field objects with new IDs.