feat(api): expose family exports (#1632)

* feat(api): expose family exports

* fix(api): harden family export review paths

* fix(api): tighten family export review paths

* fix(api): reject invalid family export params

* fix(api): address family export review

* fix(api): share uuid guard for exports
This commit is contained in:
ghost
2026-05-03 03:29:29 -06:00
committed by GitHub
parent 6c84fc760e
commit 50936000e7
11 changed files with 803 additions and 6 deletions

View File

@@ -0,0 +1,15 @@
# frozen_string_literal: true
json.id family_export.id
json.status family_export.status
json.filename family_export.filename
json.downloadable family_export.downloadable?
json.download_path family_export.downloadable? ? download_api_v1_family_export_path(family_export) : nil
attached = family_export.export_file.attached?
json.file do
json.attached attached
json.byte_size attached ? family_export.export_file.byte_size : nil
json.content_type attached ? family_export.export_file.content_type : nil
end
json.created_at family_export.created_at
json.updated_at family_export.updated_at

View File

@@ -0,0 +1,12 @@
# frozen_string_literal: true
json.data do
json.array! @family_exports, partial: "api/v1/family_exports/family_export", as: :family_export
end
json.meta do
json.page @pagy.page
json.per_page @per_page
json.total_count @pagy.count
json.total_pages @pagy.pages
end

View File

@@ -0,0 +1,5 @@
# frozen_string_literal: true
json.data do
json.partial! "api/v1/family_exports/family_export", family_export: @family_export
end