Fix postgres group error on Sandwiches route
This commit is contained in:
parent
085ae08b74
commit
c118f81b0a
1 changed files with 2 additions and 0 deletions
|
@ -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
|
||||
|
|
Reference in a new issue