Archived
1
0
Fork 0

Fix postgres group error on Sandwiches route

This commit is contained in:
Ethanell 2020-10-01 10:40:18 +02:00
parent 085ae08b74
commit c118f81b0a

View file

@ -13,9 +13,11 @@ router.get("/", sessionCheck(1), async (req, res) => {
sandwiches: await models.Sandwich.findAll({
attributes: ["name", [sequelize.fn("COUNT", sequelize.col("name")), "number"]],
include: [{
attributes: [],
model: models.Order,
where: {paid: true},
through: {
attributes: [],
where: {date: date}
},
required: true