Skip to content

Commit

Permalink
Update server.js
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulinaWywrot committed Feb 6, 2024
1 parent 932a230 commit 5cffe7a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions server/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,8 @@ app.post("/videos", function (req, res) {

const query = `INSERT INTO videos (title, url, rating) VALUES ($1, $2, $3)`;
if (req.body.title && req.body.url && isUrl(req.body.url)) {
const result = db
.query(query, [newTitle, newUrl, newRating])
.then(() => {
db.query(query, [newTitle, newUrl, newRating])
.then((result) => {
res.status(201).json(result.rows);
})
.catch((err) => {
Expand Down

0 comments on commit 5cffe7a

Please sign in to comment.