mirror of
https://github.com/we-promise/sure.git
synced 2026-04-19 20:14:08 +00:00
Add API endpoint for triggering family sync (#423)
* Add API endpoint for triggering family sync Introduces Api::V1::SyncController with a create action to queue a family sync, applying all active rules and syncing accounts. Adds corresponding route, JSON response view, and comprehensive controller tests for authorization and response validation. * Rename started_at to syncing_at in sync API response Updated the sync create JSON response to use 'syncing_at' instead of 'started_at'. Adjusted related controller test to check for 'syncing_at'. Also updated API authentication header in test to use 'X-Api-Key' instead of Bearer token. * Update app/controllers/api/v1/sync_controller.rb Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Mark Hendriksen <hendriksen-mark@hotmail.com> --------- Signed-off-by: Mark Hendriksen <hendriksen-mark@hotmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
11
app/views/api/v1/sync/create.json.jbuilder
Normal file
11
app/views/api/v1/sync/create.json.jbuilder
Normal file
@@ -0,0 +1,11 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
json.id @sync.id
|
||||
json.status @sync.status
|
||||
json.syncable_type @sync.syncable_type
|
||||
json.syncable_id @sync.syncable_id
|
||||
json.syncing_at @sync.syncing_at
|
||||
json.completed_at @sync.completed_at
|
||||
json.window_start_date @sync.window_start_date
|
||||
json.window_end_date @sync.window_end_date
|
||||
json.message "Sync has been queued and will apply all active rules"
|
||||
Reference in New Issue
Block a user