Rails/Routes_And_Controllers/Art_Share_API(Part_Two)/artworks_controller.rb question

My question is very specific to Art Share API(part_two), in bonus phase II we create the feature to favorite artworks.

Reference app/controllers/artworks_controller.rb lines 59 and 66 of your solution.

Why would we be using ::Artwork.find_by(id: params[:id], artist_id: params[:user_id]) instead of just Artwork.find(params[:id])? Why would we have to also search by artist_id, if we’re flipping the boolean to favorite an artwork isn’t finding by the ::Artwork.id all that’s needed?

Thanks again! :smile: