2.2 KiB
2.2 KiB
task, cycles, context, private, started, finished
| task | cycles | context | private | started | finished |
|---|---|---|---|---|---|
| Fix "Assign Product" button in ViewStoreMarket — navigate to global product picker instead of marketplace browser | 5 | true | false | 2026-05-16T08:17:15Z | 2026-05-16T08:17:30Z |
files
- resources/js/Pages/ViewStoreMarket.vue [lines 117-122] —
assignProduct()navigates to wrong page (ListProductsMarketinstead ofAddProductsToStore) - resources/js/Pages/AddProductsToStore.vue [lines 1-80] — correct target page; receives
targetprop as store hash; fetches global products from/Products/GlobalList
steps
- In
resources/js/Pages/ViewStoreMarket.vueat theassignProduct()function (line 117), change the navigation destination fromListProductsMarket(withprops: { data: { store_hash: props.target } }) toAddProductsToStore(withprops: { target: props.target }). This matches exactly howaddProduct()already navigates at line 110.
context
// ViewStoreMarket.vue — CURRENT (wrong)
const assignProduct = () => {
navigate({
page: 'ListProductsMarket', // ← marketplace browser, not the picker
props: { data: { store_hash: props.target } }
});
};
// ViewStoreMarket.vue — CORRECT (target fix)
const assignProduct = () => {
navigate({
page: 'AddProductsToStore', // ← global product picker
props: { target: props.target } // store hash — same as addProduct() uses
});
};
AddProductsToStore.vue defineProps:
const props = defineProps({
target: { type: String, default: null }, // store hash
});
const storeHash = computed(() => props.target);
AddProductsToStore fetches /Products/GlobalList → listGlobalProductsForPicker → returns all active global products with { success: true, products: [...] }. This is the two-step picker UI (PICK → EDIT) that the user expects.
addProduct() (line 110-115) already does this navigation correctly. assignProduct() must mirror it.
notes
- dictionary: ai-docs/dictionary.md
- linters: eslint:no, phpcs:no, tsc:no
- constraints: Only one line of navigation call changes; no backend changes needed. Build (
npm run build) after editing.