Skip to content
Snippets Groups Projects
Commit cc4bc2c9 authored by Arnaud Levy's avatar Arnaud Levy
Browse files

ready for pexels

parent 6e1cf83e
No related branches found
No related tags found
No related merge requests found
...@@ -26,15 +26,10 @@ class Admin::Communication::PhotoImportController < Admin::Communication::Applic ...@@ -26,15 +26,10 @@ class Admin::Communication::PhotoImportController < Admin::Communication::Applic
@total = 0 @total = 0
@total_pages = 0 @total_pages = 0
if @query.present? if @query.present?
p = { page = params[:page].presence || 1
query: @query, per_page = params[:per_page].presence || 10
page: (params[:page].presence || 1), @search = Pexels::Client.new.photos.search(@query, page: page, per_page: per_page)
per_page: (params[:per_page].presence || 10), @total = @search.total_results
lang: (params[:lang].presence || 'en')
}
p[:orientation] = params[:orientation] if params.has_key? :orientation
@search = Unsplash::Search.search "/search/photos", Unsplash::Photo, p
@total = @search.total
@total_pages = @search.total_pages @total_pages = @search.total_pages
end end
end end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment