'use strict';
// External Modules -----------------------------------------------------
const express = require('express');

// My own Modules ------------------------------------------------------
const Project = require('../database/projects/project.model');

// Definitions ---------------------------------------------------------
const router = express.Router();

// APIs ----------------------------------------------------------------
router.post('/create', (req, res, next) => {
  Project.addProject(req.body, (err, project) => {
    if(err) {
      res.json({success: false, msg: 'Falla al crear proyecto'});
    }
    else {
      res.json({success: true, msg: 'Proyecto creado correctamente'});
    }
  });
});

router.post('/delete', (req, res, next) => {
  Project.delete(req.body.projectId, err => {
    if(err) {
      res.json({success: false, msg: 'Falla al eliminar proyecto'});
    }
    else {
      Project.getProjects(req.body.masterId, (err, projects) => {
        res.json({
          success: true,
          msg: 'Proyecto eliminado correctamente',
          projects: projects
        });
      });
    }  
  });
});

module.exports = router;
@@ -630,34 +630,113 @@
 lse %7B%0A      
-res.json(%7B
+Project.getProjects(req.body.masterId, (err, projects) =%3E %7B%0A        res.json(%7B%0A          
 success: tru
@@ -737,16 +737,26 @@
 s: true,
+%0A         
  msg: 'P
@@ -784,16 +784,65 @@
 tamente'
+,%0A          projects: projects%0A        %7D);%0A      
 %7D);%0A    
@@ -842,16 +842,17 @@
 );%0A    %7D
+ 
 %0A  %7D);%0A%7D

Create project API responses the projects list