Class: Zizia::PreIngestWorksController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/zizia/pre_ingest_works_controller.rb

Instance Method Summary collapse

Instance Method Details

#thumbnailsObject



8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'app/controllers/zizia/pre_ingest_works_controller.rb', line 8

def thumbnails
  pre_ingest_work = Zizia::PreIngestWork.where(deduplication_key: pre_ingest_works_params[:deduplication_key]).first

  @thumbnails = if pre_ingest_work
                  pre_ingest_work.thumbnails
                else
                  []
                end

  respond_to do |format|
    format.json { render json: { thumbnails: @thumbnails } }
  end
end