You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Can't update a product - round trip read/write fails #64
I just tried to update a product and it seems that it is complaining about fields being null. You should be able to "round trip" a read/write. As a workaround how to do remove those additional fields from the update?
(byebug) product = client.products.where(sku: "Hold").first
#<BaseCRM::Product id=3036919, updated_at="2019-03-31T09:13:12Z", created_at="2019-03-31T09:13:12Z", active=true, description=nil, name="Hold Plan", sku="Hold", prices=[{:currency=>"USD", :amount=>"25.00"}], max_discount=nil, max_markup=nil, cost=nil, cost_currency=nil>
(byebug) product.name = "New Name"
"New Name"
(byebug) client.products.update(product)
*** BaseCRM::ErrorsCollection Exception: [b9qc3-kh39i-cqe7c-usmp0] http_status=422 Unprocessable Entity
code=blank message=attribute can't be blank details=This field may not be null. resource=product field=/data/cost
code=blank message=attribute can't be blank details=This field may not be null. resource=product field=/data/cost_currency
code=blank message=attribute can't be blank details=This field may not be null. resource=product field=/data/description
code=blank message=attribute can't be blank details=This field may not be null. resource=product field=/data/max_markup
Activity