update project

This commit is contained in:
Takeshi Kimata
2024-02-18 18:44:32 +09:00
parent 4586c84b4e
commit 31c74ae769
6 changed files with 121 additions and 22 deletions

View File

@@ -9,11 +9,7 @@ module.exports = function (sequelize) {
router.delete("/:projectId", async (req, res) => {
const projectId = req.params.projectId;
try {
const project = await Project.findOne({
where: {
id: projectId,
},
});
const project = await Project.findByPk(projectId);
if (!project) {
return res.status(404).send("Project not found");
}