fix: correct page directory casing for case-sensitive filesystems
Rename admin/ → Admin/ and swagger/ → Swagger/ to match router imports. Windows is case-insensitive so the mismatch was invisible locally. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
29
ui/src/pages/Swagger/SwaggerPage.tsx
Normal file
29
ui/src/pages/Swagger/SwaggerPage.tsx
Normal file
@@ -0,0 +1,29 @@
|
||||
import { useEffect, useRef } from 'react';
|
||||
import { config } from '../../config';
|
||||
|
||||
export default function SwaggerPage() {
|
||||
const containerRef = useRef<HTMLDivElement>(null);
|
||||
|
||||
useEffect(() => {
|
||||
let cleanup: (() => void) | undefined;
|
||||
|
||||
import('swagger-ui-dist/swagger-ui-bundle').then(({ default: SwaggerUIBundle }) => {
|
||||
if (!containerRef.current) return;
|
||||
SwaggerUIBundle({
|
||||
url: `${config.apiBaseUrl}/api-docs`,
|
||||
domNode: containerRef.current,
|
||||
presets: [],
|
||||
layout: 'BaseLayout',
|
||||
});
|
||||
});
|
||||
|
||||
return () => cleanup?.();
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div>
|
||||
<h2 style={{ marginBottom: '1rem' }}>API Documentation</h2>
|
||||
<div ref={containerRef} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user