To migrate discontinued assets API to the theme app blocks, you need to use the app’s metafields instead. Here’s a general outline of how you can do it:
In your app, create a new metafield for the data you want to migrate. This metafield can be of type “json” or “list.single_line_text_field”, depending on the type of data you want to store.
In your app’s code, retrieve the data from the discontinued assets API and store it in the new metafield. You can use the Shopify API to retrieve the data and then set the value of the metafield using the “PUT /admin/api/2021-09/metafields/{metafield_id}.json” API endpoint.
In your theme app block settings, use the app’s metafield to populate the select options. Here’s an example of what the code might look like:
In this example, the “options” field is populated with the value of the “some_select” metafield from the “appsomething” namespace.