Make project table associated with the user

This commit is contained in:
Takeshi Kimata
2024-05-22 22:33:21 +09:00
parent 704f20239e
commit 7a0bb63e7b
17 changed files with 174 additions and 24 deletions

View File

@@ -8,7 +8,7 @@ module.exports = function (sequelize) {
router.put('/:projectId', async (req, res) => {
const projectId = req.params.projectId;
const { name, detail } = req.body;
const { name, detail, isPublic } = req.body;
try {
const project = await Project.findByPk(projectId);
if (!project) {
@@ -17,6 +17,7 @@ module.exports = function (sequelize) {
await project.update({
name,
detail,
isPublic,
});
res.json(project);
} catch (error) {