Skip to content

Commit

Permalink
Remove POST create method from user skills controller
Browse files Browse the repository at this point in the history
  • Loading branch information
alessandromontividiu03 authored and kaiomagalhaes committed Oct 22, 2024
1 parent 7e3a179 commit d968307
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions app/controllers/user_skills_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,6 @@ def index
render json: @user_skills
end

# POST /user_skills
def create
@user_skill = UserSkill.new(user_skill_params)

if @user_skill.save
render json: @user_skill, status: :created, location: @user_skill
else
render json: @user_skill.errors, status: :unprocessable_entity
end
end

# PATCH/PUT /user_skills
def bulk_update
ApplicationRecord.transaction do
Expand Down Expand Up @@ -56,6 +45,8 @@ def set_user_skill

# Only allow a trusted parameter "white list" through.
def user_skills_list_params
return [] if params.dig(:params, :user_skills).blank?

params.require(:params).require(:user_skills).map do |skill|
skill.permit(:last_applied_in_year, :level, :years_of_experience, :skill_id)
end
Expand Down

0 comments on commit d968307

Please sign in to comment.