added filter criteria models
This commit is contained in:
20
front-api/controllers/filter_criteria.rb
Normal file
20
front-api/controllers/filter_criteria.rb
Normal file
@@ -0,0 +1,20 @@
|
||||
get '/filter/section/:id' do |id_s|
|
||||
# get filter criteria for a section with id
|
||||
FilterCriteria.where(:owner_type => "Section").where(:owner_id => id_s.to_i).to_json(
|
||||
:include => [:filter_criteria_values]
|
||||
)
|
||||
end
|
||||
|
||||
get '/filter/category/:id' do |id_s|
|
||||
# get filter criteria for a category with id
|
||||
FilterCriteria.where(:owner_type => "Category").where(:owner_id => id_s.to_i).to_json(
|
||||
:include => [:filter_criteria_values]
|
||||
)
|
||||
end
|
||||
|
||||
get '/filter/subcategory/:id' do |id_s|
|
||||
# get filter criteria for a subcategory with id
|
||||
FilterCriteria.where(:owner_type => "Subcategory").where(:owner_id => id_s.to_i).to_json(
|
||||
:include => [:filter_criteria_values]
|
||||
)
|
||||
end
|
||||
Reference in New Issue
Block a user