Add Re-sync button for SimpleFIN connections
Resets LastSyncAt on all linked accounts so the next sync
re-fetches the full 90-day transaction window. Duplicate
detection prevents re-importing existing transactions.
- POST /api/bank-sync/connections/{id}/reset-sync endpoint
- Re-sync button shown only on SimpleFIN connection cards
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -184,6 +184,16 @@
|
||||
>
|
||||
Sync Now
|
||||
</v-btn>
|
||||
<v-btn
|
||||
v-if="conn.provider === 'SimpleFIN'"
|
||||
variant="tonal"
|
||||
color="secondary"
|
||||
prepend-icon="mdi-refresh"
|
||||
:loading="resyncingConnections[conn.id]"
|
||||
@click="resyncFromScratch(conn)"
|
||||
>
|
||||
Re-sync
|
||||
</v-btn>
|
||||
<v-btn
|
||||
variant="tonal"
|
||||
:color="conn.isActive ? 'warning' : 'success'"
|
||||
@@ -530,6 +540,7 @@ const connections = ref<SyncConnection[]>([])
|
||||
const accounts = ref<Account[]>([])
|
||||
const syncIntervals = reactive<Record<string, number>>({})
|
||||
const syncingConnections = reactive<Record<string, boolean>>({})
|
||||
const resyncingConnections = reactive<Record<string, boolean>>({})
|
||||
|
||||
// Plaid credentials
|
||||
const plaidCredentials = ref<PlaidCredentials>({ isConfigured: false, environment: 'sandbox' })
|
||||
@@ -814,6 +825,20 @@ async function syncNow(conn: SyncConnection) {
|
||||
}
|
||||
}
|
||||
|
||||
async function resyncFromScratch(conn: SyncConnection) {
|
||||
resyncingConnections[conn.id] = true
|
||||
try {
|
||||
await bankSyncApi.resetSync(conn.id)
|
||||
await bankSyncApi.syncNow(conn.id)
|
||||
syncingConnections[conn.id] = true
|
||||
} catch (err: any) {
|
||||
errorMessage.value = err.response?.data?.error || 'Re-sync failed'
|
||||
showError.value = true
|
||||
} finally {
|
||||
resyncingConnections[conn.id] = false
|
||||
}
|
||||
}
|
||||
|
||||
// Handle sync results via SignalR notification
|
||||
const { notifications } = useNotifications()
|
||||
watch(notifications, (notifs) => {
|
||||
|
||||
Reference in New Issue
Block a user