rubber-blueR
Refine3y ago
5 replies
rubber-blue

How to Handle Routes for Resources that are Related

I have organizations that have many deployments and users, and deployments have many devices

How sould I structure my resources routes in the <Refine> component under the resources property to handle this?

Should I do something like for uses:
{
  name: "users",
  list: "/organizations/users",
  create: "/organizations/users/create",
  edit: "/organizations/users/edit/:id",
  meta: {
    label: "Users",
    icon: <GroupIcon />,
    canDelete: true,
  },
},


or should I do:
{
  name: "users",
  list: "/organizations/:id/users",
  create: "/organizations/:id/users/create",
  edit: "/organizations/:id/users/edit/:id",
  meta: {
    label: "Users",
    icon: <GroupIcon />,
    canDelete: true,
  },
},


Can i use the same :id notifier, or does it need to be different if its used multiple times within the same route?
Was this page helpful?