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({
|
sandwiches: await models.Sandwich.findAll({
|
||||||
attributes: ["name", [sequelize.fn("COUNT", sequelize.col("name")), "number"]],
|
attributes: ["name", [sequelize.fn("COUNT", sequelize.col("name")), "number"]],
|
||||||
include: [{
|
include: [{
|
||||||
|
attributes: [],
|
||||||
model: models.Order,
|
model: models.Order,
|
||||||
where: {paid: true},
|
where: {paid: true},
|
||||||
through: {
|
through: {
|
||||||
|
attributes: [],
|
||||||
where: {date: date}
|
where: {date: date}
|
||||||
},
|
},
|
||||||
required: true
|
required: true
|
||||||
|
|
Reference in a new issue