public async Task <IActionResult> MoveNode([FromBody] MoveElementModel model)
        {
            var response = await _nodeService.MoveNodeAsync(model);

            var mappedTree = _mapper.Map <IEnumerable <NodeModel> >(response);

            return(Ok(mappedTree));
        }
Beispiel #2
0
        public async Task <IEnumerable <Node> > MoveNodeAsync(MoveElementModel model)
        {
            var node = await _context.Nodes.SingleOrDefaultAsync(x => x.NodeId == model.ElementId);

            node.ParentNodeId = model.ToNodeId;
            await _context.SaveChangesAsync();

            var tree = await _treeService.GetTreeAsync();

            return(tree);
        }