-
Notifications
You must be signed in to change notification settings - Fork 482
Description
Issue summary
In v12.5.0, you could update the value of an asset by fetching it, setting a new value, and then saving it:
asset = ShopifyAPI::Asset.all(asset: { key: "layout/theme.liquid" }, theme_id: theme.id).first
asset.value = asset.value + "<p>Something new</p>\n"
asset.save!In v13.0.0, updating an asset results in a 406 Not Acceptable error.
I'm fairly confident this is broken because of the changes made in #1149. We're no longer sending up the required key parameter (because it hasn't changed).
With access to the asset API being removed in API version 2023-04, I'm not super hopeful that this is actually going to get fixed 🙈
shopify_apiversion: v13.0.0- Ruby version: 3.2.2
- Operating system: Ubuntu 22.04 LTS
Expected behavior
Updating an asset should behave similar to the way it did in v12.5.0 (in that it should work 😄). Including the key when we save the model would fix the problem.
v12.5.0 was obviously sending up more attributes than it should have, but it did work. See the screenshot below. Excuse the large code block - I'm replicating how the gem (incorrectly) determined which attributes changed in v12.5.0.
Actual behavior
In v13.0.0, updating an asset results in a 406 Not Acceptable error. Note that I'm using the new private methods introduced in #1149 for determining the changed attributes.
Steps to reproduce the problem
- Fetch an asset
- Change the asset's
value - Try to save the asset