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
@total = 0
@total_pages = 0
if @query.present?
p = {
query: @query,
page: (params[:page].presence || 1),
per_page: (params[:per_page].presence || 10),
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
page = params[:page].presence || 1
per_page = params[:per_page].presence || 10
@search = Pexels::Client.new.photos.search(@query, page: page, per_page: per_page)
@total = @search.total_results
@total_pages = @search.total_pages
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