You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So this is more of a UX concern—you're showing delete buttons for every post, even ones I don't own. Clicking one doesn't do anything at all (which is good! much better than letting me delete other people's posts 😅). However it would be nice to both only show the button for posts I can delete (i.e. putting a condition to check the owner when you render the posts list), and to show some kind of error if I do manage to send a POST to delete a post I don't own.
This is a clever solution—using SQL to avoid writing your own checks in JS. However in this case it means you don't have a way to determine whether the delete happened or not. If you want to show the user an error when they try to delete a post that they don't own you'll have to do that check in JS before making the DB query.
The text was updated successfully, but these errors were encountered:
So this is more of a UX concern—you're showing delete buttons for every post, even ones I don't own. Clicking one doesn't do anything at all (which is good! much better than letting me delete other people's posts 😅). However it would be nice to both only show the button for posts I can delete (i.e. putting a condition to check the owner when you render the posts list), and to show some kind of error if I do manage to send a POST to delete a post I don't own.
week3-aaae/database/model.js
Lines 55 to 58 in 33325a1
This is a clever solution—using SQL to avoid writing your own checks in JS. However in this case it means you don't have a way to determine whether the delete happened or not. If you want to show the user an error when they try to delete a post that they don't own you'll have to do that check in JS before making the DB query.
The text was updated successfully, but these errors were encountered: