diff --git a/orchestrator/src/client/api/client.ts b/orchestrator/src/client/api/client.ts index 1ed5c9f..9d736b9 100644 --- a/orchestrator/src/client/api/client.ts +++ b/orchestrator/src/client/api/client.ts @@ -171,15 +171,11 @@ export async function getSettings(): Promise { } export async function getProfileProjects(): Promise { - return fetchApi('/profile/projects', { - method: 'POST', - }); + return fetchApi('/profile/projects'); } export async function getProfile(): Promise { - return fetchApi('/profile', { - method: 'POST', - }); + return fetchApi('/profile'); } diff --git a/orchestrator/src/server/api/routes/profile.test.ts b/orchestrator/src/server/api/routes/profile.test.ts index 9e91930..52ec3e4 100644 --- a/orchestrator/src/server/api/routes/profile.test.ts +++ b/orchestrator/src/server/api/routes/profile.test.ts @@ -22,4 +22,12 @@ describe.sequential('Profile API routes', () => { expect(body.success).toBe(true); expect(Array.isArray(body.data)).toBe(true); }); + + it('returns full base resume profile', async () => { + const res = await fetch(`${baseUrl}/api/profile`); + const body = await res.json(); + expect(body.success).toBe(true); + expect(body.data).toBeDefined(); + expect(typeof body.data).toBe('object'); + }); }); diff --git a/orchestrator/src/server/api/routes/profile.ts b/orchestrator/src/server/api/routes/profile.ts index e35803b..5a7ab3c 100644 --- a/orchestrator/src/server/api/routes/profile.ts +++ b/orchestrator/src/server/api/routes/profile.ts @@ -4,9 +4,9 @@ import { extractProjectsFromProfile, loadResumeProfile } from '../../services/re export const profileRouter = Router(); /** - * POST /api/profile/projects - Get all projects available in the base resume + * GET /api/profile/projects - Get all projects available in the base resume */ -profileRouter.post('/projects', async (req: Request, res: Response) => { +profileRouter.get('/projects', async (req: Request, res: Response) => { try { const profile = await loadResumeProfile(); const { catalog } = extractProjectsFromProfile(profile); @@ -18,9 +18,9 @@ profileRouter.post('/projects', async (req: Request, res: Response) => { }); /** - * POST /api/profile - Get the full base resume profile + * GET /api/profile - Get the full base resume profile */ -profileRouter.post('/', async (req: Request, res: Response) => { +profileRouter.get('/', async (req: Request, res: Response) => { try { const profile = await loadResumeProfile(); res.json({ success: true, data: profile });