fix customer detail to point account transition
This commit is contained in:
@@ -292,11 +292,23 @@ async function toLedger(): Promise<void> {
|
||||
query: {
|
||||
customerId: selectedCustomerId.value,
|
||||
accountId: account.value?.id || "",
|
||||
storeId: selectedStoreId.value
|
||||
storeId: selectedStoreId.value,
|
||||
transitionDepth: String(getCurrentRouteDepth() + 1)
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function getCurrentRouteDepth(): number {
|
||||
const transitionDepth = Array.isArray(route.query.transitionDepth)
|
||||
? route.query.transitionDepth[0]
|
||||
: route.query.transitionDepth;
|
||||
const depth = Number(transitionDepth);
|
||||
if (transitionDepth && Number.isInteger(depth) && 0 <= depth && depth <= 20) {
|
||||
return depth;
|
||||
}
|
||||
return Number(route.meta.depth ?? 0);
|
||||
}
|
||||
|
||||
async function toAdjust(): Promise<void> {
|
||||
if (!selectedCustomerId.value) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user