Merge branch 'main' into staging
This commit is contained in:
commit
e1fd895d1a
3 changed files with 20 additions and 4 deletions
|
|
@ -185,7 +185,6 @@ module Api
|
|||
|
||||
def authorize
|
||||
# Create
|
||||
ap @party
|
||||
unauthorized_create = @party && (@party.user != current_user || @party.edit_key != edit_key)
|
||||
unauthorized_update = @weapon && @weapon.party && (@weapon.party.user != current_user || @weapon.party.edit_key != edit_key)
|
||||
|
||||
|
|
|
|||
|
|
@ -150,7 +150,7 @@ module Api
|
|||
|
||||
def mismatched_skill(job, skill)
|
||||
mismatched_main = (skill.job.id != job.id) && skill.main && !skill.sub
|
||||
mismatched_emp = (skill.job.id != job.id) && skill.emp
|
||||
mismatched_emp = (skill.job.id != job.id && skill.job.base_job.id != job.base_job.id) && skill.emp
|
||||
mismatched_base = skill.job.base_job && (job.row != 'ex2' || skill.job.base_job.id != job.base_job.id) && skill.base
|
||||
|
||||
if %w[4 5 ex2].include?(job.row)
|
||||
|
|
|
|||
|
|
@ -140,17 +140,27 @@ module Api
|
|||
|
||||
# Perform the query
|
||||
skills = if search_params[:query].present? && search_params[:query].length >= 2
|
||||
JobSkill.method("#{locale}_search").call(search_params[:query])
|
||||
JobSkill.joins(:job)
|
||||
.method("#{locale}_search").call(search_params[:query])
|
||||
.where(conditions)
|
||||
.where(job: job.id, main: false)
|
||||
.or(
|
||||
JobSkill.method("#{locale}_search").call(search_params[:query])
|
||||
JobSkill.joins(:job)
|
||||
.method("#{locale}_search").call(search_params[:query])
|
||||
.where(conditions)
|
||||
.where(sub: true)
|
||||
.where.not(job: job.id)
|
||||
)
|
||||
.or(
|
||||
JobSkill.joins(:job)
|
||||
.method("#{locale}_search").call(search_params[:query])
|
||||
.where(conditions)
|
||||
.where(job: { base_job: job.base_job.id }, emp: true)
|
||||
.where.not(job: job.id)
|
||||
)
|
||||
else
|
||||
JobSkill.all
|
||||
.joins(:job)
|
||||
.where(conditions)
|
||||
.where(job: job.id, main: false)
|
||||
.or(
|
||||
|
|
@ -165,6 +175,13 @@ module Api
|
|||
.where(job: job.base_job.id, base: true)
|
||||
.where.not(job: job.id)
|
||||
)
|
||||
.or(
|
||||
JobSkill.all
|
||||
.where(conditions)
|
||||
.joins(:job)
|
||||
.where(job: { base_job: job.base_job.id }, emp: true)
|
||||
.where.not(job: job.id)
|
||||
)
|
||||
end
|
||||
|
||||
count = skills.length
|
||||
|
|
|
|||
Loading…
Reference in a new issue