-
-
Save anonymous/6c4f1e1e8fd42fd3114ac6027d1e3b0a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
imageController.saveNewImage = (req,res) =>{ | |
console.log(req.body); | |
const image = { | |
image_title: req.body.title, | |
image_description: req.body.description, | |
image_path: req.body.path, | |
image_created_at: new Date() | |
}; | |
knex('images') | |
.insert(image) | |
.then ( newImage =>{ | |
res.json(newImage); | |
}) | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"command": "INSERT", | |
"rowCount": 1, | |
"oid": 0, | |
"rows": [], | |
"fields": [], | |
"_parsers": [], | |
"RowCtor": null, | |
"rowAsArray": false | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"id":12, | |
"image_title":"test image", | |
"image_description":"test description", | |
"image_path":"test image path", | |
... | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"title":"test image", | |
"description":"Test description", | |
"path":"test image path" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment