feat: change usermanagement from git submodule to componenet based

This commit is contained in:
mengstabketemaw
2026-06-23 11:10:35 +03:00
parent 9c035e7333
commit f876d57219
34 changed files with 2601 additions and 3622 deletions

View File

@@ -30,7 +30,6 @@ import {
IconShieldCheck,
} from '@tabler/icons-react';
import { authStorage } from '@ema-platform/auth';
import { useAppSelector } from '../../../store/hooks';
// ---------------------------------------------------------------------------
// Mock data
@@ -77,7 +76,7 @@ async function generateCertificate(profileId: string): Promise<Blob> {
const token = authStorage.getToken();
if (!token) throw new Error('No auth token found');
const res = await fetch(
`${API_BASE}/profiles/generate-seafarer-certificate/e04c4a7c-0feb-4af6-ab00-5ef6600ee2b4`,
`${API_BASE}/profiles/generate-seafarer-certificate/${profileId}`,
{ headers: { Authorization: `Bearer ${token}` } },
);
if (!res.ok) throw new Error(`Failed to generate certificate (${res.status})`);
@@ -95,8 +94,7 @@ function downloadBlob(blob: Blob, filename: string) {
export function CertificatesPage() {
const navigate = useNavigate();
const user = useAppSelector((state) => state.auth.user);
const profileId = user?.id ?? '';
const profileId = authStorage.getProfileId() ?? '';
const [previewUrl, setPreviewUrl] = useState<string | null>(null);
const [previewTitle, setPreviewTitle] = useState('');
const [loading, setLoading] = useState(false);