upd
This commit is contained in:
@@ -40,16 +40,12 @@ router.post("/", async (req, res) => {
|
||||
});
|
||||
|
||||
router.put("/:id", async (req, res) => {
|
||||
console.log(req.body);
|
||||
|
||||
try {
|
||||
const project = await Project.findByIdAndUpdate(req.params.id, req.body, {
|
||||
upsert: true,
|
||||
new: true,
|
||||
});
|
||||
|
||||
console.log("updated", project);
|
||||
|
||||
return res.json(project);
|
||||
} catch (error) {
|
||||
if (error instanceof Error) {
|
||||
@@ -59,8 +55,6 @@ router.put("/:id", async (req, res) => {
|
||||
});
|
||||
|
||||
router.delete("/:id", async (req, res) => {
|
||||
console.log(req.body);
|
||||
|
||||
try {
|
||||
const project = await Project.findByIdAndDelete(req.params.id);
|
||||
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 100 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 160 KiB |
Reference in New Issue
Block a user