mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-03-10 01:01:16 -04:00
fix(api): return all privacy values so client can update them (#65620)
This commit is contained in:
committed by
GitHub
parent
c7a37a98d2
commit
12082f5547
@@ -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
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user