Values repeating when values adding to Globals in layout

I have created a master layout for my web application in which I am storing items of menu for dashboard with their routing links, icons etc in view global.
When page renders index.edge, all work fine, when I move to create.edge item.path repeated.
on index : item.child.path= ‘/dashboard/user/create’
on create: item.child.path= ‘/dashboard/user/dashboard/user/create’

why it is repeating when calling another view ? is it looping again in sidebar.edge, if yes, then how to handle this ?


             let privilege_id = '1'
            let menu = await menuService.getMenu(privilege_id)
  'menu', menu)
            return view.render('dashboard.index', { menu: menu })

layout is like this

          |-- index.edge
          |-- create.edge
     |-- layout
          |-- dashboard
               |-- partials
                    |-- header.edge
                    |-- nav.edge
                    |-- sidebar.edge
                    |-- footer.edge
               |-- master.edge

my menu items comes in sidebar.edge every page index.edge and create.edge use master layout at top.

//create.js / index.js
<!-- HTML content starts here for create user / index -->

this is how sidebar is written

<div class="menu_section">
      <h3>General Section</h3>
      <ul class="nav side-menu">
        @each(item in menu)
          @if(item.path != null)
          <a  href="{{item.path}}">
          <i class="{{item.icon}}"></i> {{}}
          @if(item.child_menu.length > 0)
          <span class="fa fa-chevron-down"></span>
          <span class=""></span>
          @if(item.child_menu.length > 0)
          <ul class="nav child_menu">
            @each(child in item.child_menu)
            <li><a href="{{child.path}}">{{}}</a></li>

Is your menu object correct in here?
Haven’t used Edge myself, but it seems like case of missing / in start of some URL