Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NW6 | Zeliha Pala | Full-Stack-Project | Week-2 | DELETE-A- Video-Recommendation #34

Merged
merged 1 commit into from
May 20, 2024

Conversation

zelihapala
Copy link
Collaborator

No description provided.

Copy link

netlify bot commented May 20, 2024

Deploy Preview for watch-next-cyf ready!

Name Link
🔨 Latest commit abb595e
🔍 Latest deploy log https://app.netlify.com/sites/watch-next-cyf/deploys/664b46b0918b200008e12d44
😎 Deploy Preview https://deploy-preview-34--watch-next-cyf.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Owner

@RbAvci RbAvci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done Zeliha!

@RbAvci RbAvci merged commit ce8406a into main May 20, 2024
6 checks passed
Copy link
Collaborator

@Ara225 Ara225 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work, one minor gripe

Comment on lines +30 to +41
router.delete("/videos/:id", async (req, res) => {
const videoId = req.params.id;

try {
await db.query("DELETE FROM videos WHERE id = $1", [videoId]);
res
.status(200)
.json({ success: true, message: "Video deleted successfully" });
} catch (error) {
res
.status(500)
.json({ success: false, error: "Failed to delete the video" });
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good. I appreciate the use of appropriate HTTP error codes and paramatized queries.

onDelete(videoId);
})
.catch((error) => {
console.error(error);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Console.error is not a great solution here. The average user never looks in the console so you should make a habit of using a visible error like a alert()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants