【发布时间】:2022-12-18 00:00:06
【问题描述】:
由于此错误,我的过滤不起作用。 我一年前做过这个,一切正常,但是当我现在打开项目并尝试启动时,发现错误,并且无法正常工作 这是我的代码:
async getAll(req, res) {
const { descriptionId, locationId } = req.query
let photos
if (!descriptionId && !locationId) {
photos = await Photo.findAll()
}
if (descriptionId && !locationId) {
photos = await Photo.findAll({ where: descriptionId })
}
if (!descriptionId && locationId) {
photos = await Photo.findAll({ where: locationId })
}
if (descriptionId && locationId) {
photos = await Photo.findAll({
where: { descriptionId, locationId },
})
}
return res.json(photos)
}
而且我的标题有错误错误。我能做什么,再也看不到这个错误?
我试图在互联网上查找信息,但没有成功。多亏了你,你阅读了这条消息并为你提供帮助!!
【问题讨论】:
标签: node.js reactjs postgresql express sequelize.js