Skip to content
Snippets Groups Projects
personController.js 446 B
Newer Older
  • Learn to ignore specific revisions
  • const db = require('../models/db');
    
    exports.getPersonInformations = (req, res, next) => {
        let personId = req.params.id;
    
        db.query('SELECT * FROM Personne WHERE nconst = ?',
            [personId], function (error, results, fields) {
    
                if (error) {
                    res.status(500).json({ error });
                } else {
                    let infos = results[0];
                    res.status(200).json(infos);
                }
            })
    };