Files
BarangaySystem/.claude/plans/0208e8092af75016a915ce1759e68bb5-complete.md
2026-06-06 18:43:00 +08:00

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 (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

// 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/GlobalListlistGlobalProductsForPicker → 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.