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,10 +8,12 @@ module.exports = function (sequelize) {
router.post('/', async (req, res) => {
try {
const { name, detail } = req.body;
const { name, detail, isPublic, userId } = req.body;
const newProject = await Project.create({
name,
detail,
isPublic,
userId,
});
res.json(newProject);
} catch (error) {