---
task: Fix "Assign Product" button in ViewStoreMarket — navigate to global product picker instead of marketplace browser
cycles: 5
context: true
private: false
started: 2026-05-16T08:17:15Z
finished: 2026-05-16T08:17:30Z
---

## files
- resources/js/Pages/ViewStoreMarket.vue [lines 117-122] — `assignProduct()` navigates to wrong page (`ListProductsMarket` instead of `AddProductsToStore`)
- resources/js/Pages/AddProductsToStore.vue [lines 1-80] — correct target page; receives `target` prop as store hash; fetches global products from `/Products/GlobalList`

## steps
1. In `resources/js/Pages/ViewStoreMarket.vue` at the `assignProduct()` function (line 117), change the navigation destination from `ListProductsMarket` (with `props: { data: { store_hash: props.target } }`) to `AddProductsToStore` (with `props: { target: props.target }`). This matches exactly how `addProduct()` already navigates at line 110.

## context
```js
// 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:
```js
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.
