mirror of
https://github.com/we-promise/sure.git
synced 2026-05-10 06:05:00 +00:00
feat(api): expose sync status (#1635)
* feat(api): expose sync status * fix(api): harden sync status review paths * fix(api): address sync status review * fix(api): tighten sync status review fixes * fix(api): address sync status review * test(api): avoid secret-like sync fixture key * test(api): reuse sync status fixture key * fix(api): align sync route helpers * fix(api): tighten sync status scoping * fix(api): make sync status schema nullable-compliant
This commit is contained in:
24
app/views/api/v1/syncs/_sync.json.jbuilder
Normal file
24
app/views/api/v1/syncs/_sync.json.jbuilder
Normal file
@@ -0,0 +1,24 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
syncable = sync.syncable
|
||||
|
||||
json.id sync.id
|
||||
json.status sync.status
|
||||
json.in_progress sync.in_progress?
|
||||
json.terminal sync.terminal?
|
||||
json.syncable do
|
||||
json.type sync.syncable_type
|
||||
json.id sync.syncable_id
|
||||
json.name syncable&.try(:name)
|
||||
end
|
||||
json.parent_id sync.parent_id
|
||||
json.children_count sync.children.size
|
||||
json.window_start_date sync.window_start_date
|
||||
json.window_end_date sync.window_end_date
|
||||
json.pending_at sync.pending_at
|
||||
json.syncing_at sync.syncing_at
|
||||
json.completed_at sync.completed_at
|
||||
json.failed_at sync.failed_at
|
||||
json.error sync.api_error_payload
|
||||
json.created_at sync.created_at
|
||||
json.updated_at sync.updated_at
|
||||
Reference in New Issue
Block a user