{{- .Auth.ByMatchingAccountID 2 }} {{- $acctID := .Identity.Account.AccountID }} {{- $stores := .Accounts.GetShops $acctID -}} {{- define "title" }} Inventory++ {{ end }}

Inventory

Synced Listings

Create a Sync Group

(Draft 2)

{{ componentBody "accounts/{acctID}/inventory/sync-table-v2" "dot" . }}
{{ componentBody "button-dev" "HXPost" (printf "/api/accounts/%d/inventory/sync-groups/draft/listings" $acctID) "HXTarget" "previous table > tbody" "HXSwap" "beforeend" "Class" "mt-[1em] mb-[1em]" "Text" "Add Listing" "_" ` on click send rowUpdated to the first in #inventory-table-2 ` }} {{/* TODO: enable the button when all listings are filled and there are at least two listings */}} {{/* TODO: save the listings as a sync group on click */}} {{ componentBody "button-dev" "ID" "create-sync-group-button" "HXPost" (printf "/api/accounts/%d/sync-groups" $acctID) "Class" "mt-[1em] mb-[1em]" "Text" "Save Sync Group" "Disabled" true "_" ` on setDisabled(disabled) if disabled then add @disabled to me else remove @disabled from me end ` }}

Draft 1

{{ componentBody "accounts/{acctID}/inventory/sync-table" "dot" . }}
{{ componentBody "accounts/{acctID}/inventory/sync-table/showcase-table" "dot" . }}
{{ componentBody "button-dev" "HXGet" (printf "/api/accounts/%d/inventory/sync-table/new-row" $acctID) "HXTarget" "#inventory-table > tbody" "HXSwap" "beforeend" "Class" "mt-[1em] mb-[1em]" "Text" "Add Row" }}