Fix for level 1 being added to skills (#73)
* single commit fix! * fix tests!
This commit is contained in:
parent
65952259ce
commit
b02dac5fe8
@ -243,7 +243,7 @@ describe("PDF Service Skills Validation", () => {
|
|||||||
expect(newSkill.description).toBe("");
|
expect(newSkill.description).toBe("");
|
||||||
// Optional but good to check
|
// Optional but good to check
|
||||||
expect(newSkill.id).toBeDefined();
|
expect(newSkill.id).toBeDefined();
|
||||||
expect(newSkill.level).toBe(1);
|
expect(newSkill.level).toBe(0);
|
||||||
|
|
||||||
// Check "Existing Skill" - should preserve existing fields if not overwritten?
|
// Check "Existing Skill" - should preserve existing fields if not overwritten?
|
||||||
// In the implementation, we look up existing.
|
// In the implementation, we look up existing.
|
||||||
|
|||||||
@ -117,8 +117,8 @@ export async function generatePdf(
|
|||||||
const { email, password, baseUrl } = await getCredentials();
|
const { email, password, baseUrl } = await getCredentials();
|
||||||
const client = new RxResumeClient(baseUrl);
|
const client = new RxResumeClient(baseUrl);
|
||||||
|
|
||||||
// Read base resume from profile (fetches from v4 API if configured)
|
// Read base resume from profile (fetches from v4 API if configured, force fetch)
|
||||||
const baseResume = JSON.parse(JSON.stringify(await getProfile()));
|
const baseResume = JSON.parse(JSON.stringify(await getProfile(true)));
|
||||||
|
|
||||||
// Sanitize skills: Ensure all skills have required schema fields (visible, description, id, level, keywords)
|
// Sanitize skills: Ensure all skills have required schema fields (visible, description, id, level, keywords)
|
||||||
// This fixes issues where the base JSON uses a shorthand format (missing required fields)
|
// This fixes issues where the base JSON uses a shorthand format (missing required fields)
|
||||||
@ -193,7 +193,7 @@ export async function generatePdf(
|
|||||||
level:
|
level:
|
||||||
newSkill.level !== undefined
|
newSkill.level !== undefined
|
||||||
? (newSkill.level as number)
|
? (newSkill.level as number)
|
||||||
: ((existing?.level as number | undefined) ?? 1),
|
: ((existing?.level as number | undefined) ?? 0),
|
||||||
keywords:
|
keywords:
|
||||||
(newSkill.keywords as string[]) ||
|
(newSkill.keywords as string[]) ||
|
||||||
(existing?.keywords as string[]) ||
|
(existing?.keywords as string[]) ||
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user