mirror of
https://github.com/we-promise/sure.git
synced 2026-05-12 15:15:01 +00:00
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:
15
app/views/api/v1/family_exports/_family_export.json.jbuilder
Normal file
15
app/views/api/v1/family_exports/_family_export.json.jbuilder
Normal 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
|
||||
12
app/views/api/v1/family_exports/index.json.jbuilder
Normal file
12
app/views/api/v1/family_exports/index.json.jbuilder
Normal 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
|
||||
5
app/views/api/v1/family_exports/show.json.jbuilder
Normal file
5
app/views/api/v1/family_exports/show.json.jbuilder
Normal 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
|
||||
Reference in New Issue
Block a user