Fix provider configuration response rendering
Align the admin page with the array response defined by the production API and OpenAPI contract so successful status loads cannot trip the route error boundary.
This commit is contained in:
@@ -59,10 +59,10 @@ export function ProvidersPage() {
|
||||
const updateStatus = useCallback((updated: ManagedProviderStatus) => {
|
||||
setOverview((current) => {
|
||||
if (!current) return current;
|
||||
const providers = current.providers.filter(
|
||||
const providers = current.filter(
|
||||
(item) => item.providerId !== updated.providerId,
|
||||
);
|
||||
return { providers: [...providers, updated] };
|
||||
return [...providers, updated];
|
||||
});
|
||||
}, []);
|
||||
|
||||
@@ -101,7 +101,7 @@ export function ProvidersPage() {
|
||||
providerId={provider.id}
|
||||
name={provider.name}
|
||||
description={provider.description}
|
||||
status={overview.providers.find((item) => item.providerId === provider.id)}
|
||||
status={overview.find((item) => item.providerId === provider.id)}
|
||||
onUpdated={updateStatus}
|
||||
/>
|
||||
))}
|
||||
|
||||
Reference in New Issue
Block a user