revert to get to not break readonly mode

This commit is contained in:
DaKheera47 2026-01-21 15:26:25 +00:00
parent 9363a58e46
commit 7c524f5d63
3 changed files with 14 additions and 10 deletions

View File

@ -171,15 +171,11 @@ export async function getSettings(): Promise<AppSettings> {
}
export async function getProfileProjects(): Promise<ResumeProjectCatalogItem[]> {
return fetchApi<ResumeProjectCatalogItem[]>('/profile/projects', {
method: 'POST',
});
return fetchApi<ResumeProjectCatalogItem[]>('/profile/projects');
}
export async function getProfile(): Promise<any> {
return fetchApi<any>('/profile', {
method: 'POST',
});
return fetchApi<any>('/profile');
}

View File

@ -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');
});
});

View File

@ -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 });