Browse Source

Filter exports by the collection

pull/2599/head
Kat 2 years ago
parent
commit
66c1b874b1
  1. 4
      app/services/exports/organisation_export_service.rb
  2. 4
      app/services/exports/user_export_service.rb

4
app/services/exports/organisation_export_service.rb

@ -4,9 +4,9 @@ module Exports
include CollectionTimeHelper
def export_xml_organisations(full_update: false)
recent_export = Export.order("started_at").last
collection = "organisations"
recent_export = Export.where(collection:).order("started_at").last
base_number = Export.where(empty_export: false, collection:).maximum(:base_number) || 1
export = build_export_run(collection, base_number, full_update)
archives_for_manifest = write_export_archive(export, collection, recent_export, full_update)

4
app/services/exports/user_export_service.rb

@ -4,9 +4,9 @@ module Exports
include CollectionTimeHelper
def export_xml_users(full_update: false)
recent_export = Export.order("started_at").last
collection = "users"
recent_export = Export.where(collection:).order("started_at").last
base_number = Export.where(empty_export: false, collection:).maximum(:base_number) || 1
export = build_export_run(collection, base_number, full_update)
archives_for_manifest = write_export_archive(export, collection, recent_export, full_update)

Loading…
Cancel
Save