Bug 38010: Fix programmatic navigation id attribute

Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Matt Blenkinsop 2024-12-04 10:54:49 +00:00 committed by Katrin Fischer
parent fe9c817f23
commit 358d94ae0c
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
5 changed files with 9 additions and 7 deletions

View File

@ -109,7 +109,7 @@ export default {
};
},
data() {
const vendorId = this.vendorid ? this.vendorid : this.params.vendor_id;
const vendorId = this.vendorid ? this.vendorid : this.params.id;
return {
vendorId,
};

View File

@ -1,5 +1,5 @@
<template>
<aside>
<aside v-if="leftNavigation !== 'none'">
<div class="sidebar_menu">
<VendorMenu v-if="leftNavigation === 'VendorMenu'" />
<AcquisitionsMenu

View File

@ -70,8 +70,8 @@ export default {
},
beforeRouteEnter(to, from, next) {
next(vm => {
if (to.params.vendor_id) {
vm.getVendor(to.params.vendor_id);
if (to.params.id) {
vm.getVendor(to.params.id);
} else {
vm.initialized = true;
}

View File

@ -120,7 +120,7 @@ export default {
},
beforeRouteEnter(to, from, next) {
next(vm => {
vm.getVendor(to.params.vendor_id);
vm.getVendor(to.params.id);
});
},
methods: {

View File

@ -33,7 +33,7 @@ export const routes = [
alternateLeftMenu: "AcquisitionsMenu",
},
{
path: ":vendor_id",
path: ":id",
name: "VendorShow",
component: markRaw(VendorShow),
title: $__("Show vendor"),
@ -44,12 +44,14 @@ export const routes = [
name: "VendorFormAdd",
component: markRaw(VendorFormAdd),
title: $__("Add vendor"),
alternateLeftMenu: "none",
},
{
path: "edit/:vendor_id",
path: "edit/:id",
name: "VendorFormAddEdit",
component: markRaw(VendorFormAdd),
title: $__("Edit vendor"),
alternateLeftMenu: "VendorMenu",
},
],
},