Skip to content

Commit

Permalink
update how the user skill is rendered
Browse files Browse the repository at this point in the history
  • Loading branch information
kaiomagalhaes committed Nov 1, 2024
1 parent bd084d9 commit 1d72607
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 1 addition & 3 deletions app/controllers/user_skills_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ class UserSkillsController < ApplicationController

# GET /user_skills?user_id=:id
def index
@user_skills = UserSkill.where(user_id: params['user_id']).joins(:skill).select('user_skills.*', 'skills.name as skill_name')

render json: @user_skills
@user_skills = UserSkill.where(user_id: params['user_id'])
end

# PATCH/PUT /user_skills
Expand Down
2 changes: 1 addition & 1 deletion app/views/user_skills/_user_skill.json.jbuilder
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

# _user_service_identifier.json.jbuilder

json.extract! user_skill, :id, :last_applied_in_year, :level, :years_of_experience
json.extract! user_skill, :id, :last_applied_in_year, :level, :years_of_experience, :skill
3 changes: 3 additions & 0 deletions app/views/user_skills/index.json.jbuilder
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# frozen_string_literal: true

json.array! @user_skills, partial: 'user_skills/user_skill', as: :user_skill
1 change: 0 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '2'
services:
db:
image: postgres
Expand Down

0 comments on commit 1d72607

Please sign in to comment.