From e295df0fdd36ed25f3739351f6a32d70a2690170 Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Sun, 27 Feb 2022 22:12:57 -0800 Subject: [PATCH] Remove log and unused parameter --- app/controllers/api/v1/favorites_controller.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/controllers/api/v1/favorites_controller.rb b/app/controllers/api/v1/favorites_controller.rb index c615cf3..26da814 100644 --- a/app/controllers/api/v1/favorites_controller.rb +++ b/app/controllers/api/v1/favorites_controller.rb @@ -12,7 +12,6 @@ class Api::V1::FavoritesController < Api::V1::ApiController elsif Favorite.where(user_id: current_user.id, party_id: party_id).length > 0 raise Api::V1::FavoriteAlreadyExistsError else - ap "Create a new favorite" object = { user_id: current_user.id, party_id: favorite_params[:party_id] @@ -25,7 +24,7 @@ class Api::V1::FavoritesController < Api::V1::ApiController def destroy raise Api::V1::UnauthorizedError unless current_user - + @favorite = Favorite.where(user_id: current_user.id, party_id: favorite_params[:party_id]).first render :destroyed, status: :ok if @favorite && Favorite.destroy(@favorite.id) end @@ -37,6 +36,6 @@ class Api::V1::FavoritesController < Api::V1::ApiController end def favorite_params - params.require(:favorite).permit(:id, :party_id) + params.require(:favorite).permit(:party_id) end end \ No newline at end of file