mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-14 19:21:39 -05:00
12 lines
373 B
Ruby
12 lines
373 B
Ruby
|
|
# frozen_string_literal: true
|
||
|
|
|
||
|
|
class Api::V1::PhotosController < ApiController
|
||
|
|
def index
|
||
|
|
@photos = Rails.cache.fetch("photos_#{params[:start_date]}_#{params[:end_date]}", expires_in: 1.day) do
|
||
|
|
Immich::RequestPhotos.new(current_api_user, start_date: params[:start_date], end_date: params[:end_date]).call
|
||
|
|
end
|
||
|
|
|
||
|
|
render json: @photos, status: :ok
|
||
|
|
end
|
||
|
|
end
|