fix: load accounting connectors even when config endpoint fails
All checks were successful
Deploy Nyla Frontend to Production / deploy (push) Successful in 45s
All checks were successful
Deploy Nyla Frontend to Production / deploy (push) Successful in 45s
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
5f47dd395c
commit
36e57a0ab4
1 changed files with 8 additions and 4 deletions
|
|
@ -88,10 +88,14 @@ export const TrusteeAccountingSettingsView: React.FC = () => {
|
||||||
if (!instanceId) return;
|
if (!instanceId) return;
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
try {
|
try {
|
||||||
const [availableConnectors, config] = await Promise.all([
|
const connectorsPromise = fetchAccountingConnectors(request, instanceId);
|
||||||
fetchAccountingConnectors(request, instanceId),
|
let config: AccountingConfig = { configured: false };
|
||||||
fetchAccountingConfig(request, instanceId),
|
try {
|
||||||
]);
|
config = await fetchAccountingConfig(request, instanceId);
|
||||||
|
} catch (configErr: any) {
|
||||||
|
console.error('Failed to load accounting config:', configErr);
|
||||||
|
}
|
||||||
|
const availableConnectors = await connectorsPromise;
|
||||||
setConnectors(availableConnectors || []);
|
setConnectors(availableConnectors || []);
|
||||||
setExistingConfig(config);
|
setExistingConfig(config);
|
||||||
if (config?.configured && config.connectorType) {
|
if (config?.configured && config.connectorType) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue