add: order paths & mds
This commit is contained in:
@@ -9,6 +9,9 @@ const SideNavigation = () => {
|
||||
const deletePath = useDeletePath();
|
||||
const updatePath = useUpdatePath();
|
||||
|
||||
const sortedPaths = paths
|
||||
? paths.slice().sort((a, b) => a.order.localeCompare(b.order))
|
||||
: [];
|
||||
const handleDelete = (id) => {
|
||||
if (window.confirm("Are you sure you want to delete this path?")){
|
||||
deletePath.mutate(id, {
|
||||
@@ -47,7 +50,7 @@ const SideNavigation = () => {
|
||||
</PermissionGuard>
|
||||
<ul className="menu-list">
|
||||
{isLoading && <p>Loading...</p>}
|
||||
{paths.map((path) => (
|
||||
{sortedPaths.map((path) => (
|
||||
<PathNode
|
||||
key={path.id}
|
||||
path={path}
|
||||
|
||||
Reference in New Issue
Block a user