fix: bank sync fehler sichtbar machen
All checks were successful
Build and Push Docker Images / build-backend (push) Successful in 26s
Build and Push Docker Images / build-frontend (push) Successful in 1m15s
Build and Push Docker Images / build-website (push) Successful in 19s
Build and Push Docker Images / build-central-services-api (push) Successful in 16s
Build and Push Docker Images / build-central-services-admin (push) Successful in 17s
Build and Push Docker Images / build-docs (push) Successful in 16s

This commit is contained in:
2026-08-05 14:12:16 +02:00
parent 8aee8e7882
commit 4e533a47c9
3 changed files with 76 additions and 67 deletions

View File

@@ -308,7 +308,16 @@ export default async function functionRoutes(server: FastifyInstance) {
})
server.post('/functions/services/bankstatementsync', async (req, reply) => {
await server.services.bankStatements.run(req.user.tenant_id);
const result = await server.services.bankStatements.run(req.user.tenant_id);
if (result.errors.length > 0) {
const firstError = result.errors[0]?.message
return reply.code(502).send({
error: 'bank_sync_failed',
message: `${result.errors.length} von ${result.accountsFound} Bankkonten konnten nicht synchronisiert werden.${firstError ? ` Ursache: ${firstError}` : ''}`,
...result,
})
}
return result
})
server.post('/functions/services/prepareincominginvoices', async (req, reply) => {