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

module.exports = {
  getOne: (req, res) => {
    models.Post.findOne({
      where: {
        id: req.params.listId,
        isDeleted: false,
      },
      include: [
        models.Picture,
        {
          model: models.User,
          include: [{
            model: models.Rating,
            include: [{ model: models.User, as: 'rater' }],
          }],
        },
      ],
    })
      .then((listing) => {
        res.send(listing);
      });
  },

  getAll: (err, res) => {
    models.Post.findAll({
      where: {
        isDeleted: false,
      },
      include: [{ model: models.Picture }],
    })
      .then((posts) => {
        res.send(posts);
      });
  },

  getAllForUser: (req, res) => {
    models.User.find({
      where: { id: req.params.id, isDeleted: false },
    })
      .then((user) => {
        user.getPosts({
          include: [{ model: models.Picture }],
        })
          .then((posts) => {
            res.json(posts);
          });
      });<commit_msg>Fix another bug in listingController with isDelete<commit_after>const models = require('../../../database/schemas.js');

module.exports = {
  getOne: (req, res) => {
    models.Post.findOne({
      where: {
        id: req.params.listId,
        isDeleted: false,
      },
      include: [
        models.Picture,
        {
          model: models.User,
          include: [{
            model: models.Rating,
            include: [{ model: models.User, as: 'rater' }],
          }],
        },
      ],
    })
      .then((listing) => {
        res.send(listing);
      });
  },

  getAll: (err, res) => {
    models.Post.findAll({
      where: {
        isDeleted: false,
      },
      include: [{ model: models.Picture }],
    })
      .then((posts) => {
        res.send(posts);
      });
  },

  getAllForUser: (req, res) => {
    models.User.find({
      where: { id: req.params.id, isDeleted: false },
    })
      .then((user) => {
        user.getPosts({
          where: { isDeleted: false },
          include: [{ model: models.Picture }],
        })
          .then((posts) => {
            res.json(posts);
          });
      });
{'fraction_non_alphanumeric': 0.18037974683544303, 'fraction_numerical': 0.0, 'mean_word_length': 1.497742663656885, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5206466', 'n_tokens_mistral': 711, 'n_tokens_neox': 697, 'n_words': 119}