fix(api): return all privacy values so client can update them (#65620)

This commit is contained in:
Oliver Eyton-Williams
2026-01-31 13:35:41 +01:00
committed by GitHub
parent c7a37a98d2
commit 12082f5547
6 changed files with 37 additions and 39 deletions

View File

@@ -78,7 +78,7 @@ describe('normalize', () => {
expect(normalizeProfileUI(input)).toEqual(defaultProfileUI);
});
test('should convert all "null" values to "undefined"', () => {
test('should convert all "null" values to "false"', () => {
const input = {
isLocked: null,
showAbout: false,
@@ -93,17 +93,17 @@ describe('normalize', () => {
showExperience: null
};
expect(normalizeProfileUI(input)).toEqual({
isLocked: undefined,
isLocked: false,
showAbout: false,
showCerts: undefined,
showDonation: undefined,
showHeatMap: undefined,
showLocation: undefined,
showName: undefined,
showPoints: undefined,
showPortfolio: undefined,
showTimeLine: undefined,
showExperience: undefined
showCerts: false,
showDonation: false,
showHeatMap: false,
showLocation: false,
showName: false,
showPoints: false,
showPortfolio: false,
showTimeLine: false,
showExperience: false
});
});
});

View File

@@ -124,9 +124,9 @@ export const normalizeChallengeType = (
*/
export const normalizeProfileUI = (
maybeProfileUI: ProfileUI | null
): NoNullProperties<ProfileUI> => {
): DefaultToFalse<ProfileUI> => {
return maybeProfileUI
? removeNulls(maybeProfileUI)
? normalizeFlags(maybeProfileUI)
: {
isLocked: true,
showAbout: false,