const models = require('../../../database/schemas.js');

module.exports = {
  getAllForUser: (req, res) => {
    models.User.findOne({
      where: {
        id: req.params.id,
      },
    })
      .then((user) => {
        user.getMessages({
          include: [
            { model: models.User, as: 'sender' },
            { model: models.Post },
          ],
        })
          .then((messages) => {
            res.json(messages);
          });
      });
  },

  createMessage: (req, res) => {
    res.send(200);
  },
};

@@ -258,16 +258,52 @@
 lude: %5B%0A
+            %7B model: models.User %7D,%0A
         

Send receiving user with api/users/:id/messages