Skip to content

Commit 8a9d793

Browse files
fix: what is agh (#1183)
* fix: what is agh * fix: show json --------- Co-authored-by: Echo <github@3kh0.net>
1 parent d6ed060 commit 8a9d793

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

app/views/admin/shop_items/_form.html.erb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,12 @@
237237
<h3>Warehouse Settings</h3>
238238
<div class="shop-item-form__field">
239239
<%= f.label :agh_contents, "AGH Contents (JSON)", class: "shop-item-form__label" %>
240-
<%= f.text_area :agh_contents, rows: 4, id: "shop_item_agh_contents", class: "form-control shop-item-form__code", placeholder: '[{"sku": "ITEM-001", "quantity": 1}]' %>
240+
<%= f.text_area :agh_contents, rows: 4, id: "shop_item_agh_contents", class: "form-control shop-item-form__code", placeholder: '[{"sku": "ITEM-001", "quantity": 1}]', value: shop_item.agh_contents.present? ? JSON.pretty_generate(shop_item.agh_contents) : '' %>
241241
<span class="shop-item-form__hint">List SKUs to include. Quantity selected by user will batch all SKUs together.</span>
242+
<div class="alert alert-warning" style="margin-top: 0.5rem;">
243+
<strong>Required:</strong> This field must contain valid JSON (not Ruby hash syntax).
244+
Use double quotes for keys and strings. <a href="https://github.com/hackclub/flavortown/issues/1172" target="_blank" rel="noopener">See issue #1172 for more info</a>.
245+
</div>
242246
</div>
243247
</div>
244248

0 commit comments

Comments
 (0)