diff --git a/src/resolvers/Mutation/updateUserProfile.ts b/src/resolvers/Mutation/updateUserProfile.ts index d63d6821a5..797fb0315d 100644 --- a/src/resolvers/Mutation/updateUserProfile.ts +++ b/src/resolvers/Mutation/updateUserProfile.ts @@ -110,6 +110,9 @@ export const updateUserProfile: MutationResolvers["updateUserProfile"] = async ( maritalStatus: args.data?.maritalStatus ? args.data.maritalStatus : currentUser?.maritalStatus, + appLanguageCode: args.data?.appLanguageCode + ? args.data.appLanguageCode + : currentUser?.appLanguageCode, phone: { home: args.data?.phone?.home ? args.data?.phone?.home @@ -128,9 +131,12 @@ export const updateUserProfile: MutationResolvers["updateUserProfile"] = async ( runValidators: true, } ).lean(); - updatedUser!.image = updatedUser?.image - ? `${context.apiRootUrl}${updatedUser?.image}` - : null; + + if (updatedUser != null) { + updatedUser.image = updatedUser?.image + ? `${context.apiRootUrl}${updatedUser?.image}` + : null; + } return updatedUser ?? ({} as InterfaceUser); }; diff --git a/src/typeDefs/inputs.ts b/src/typeDefs/inputs.ts index d0bdd94af4..cb02c7412f 100644 --- a/src/typeDefs/inputs.ts +++ b/src/typeDefs/inputs.ts @@ -334,6 +334,7 @@ export const inputs = gql` } input UpdateUserInput { + appLanguageCode: String address: AddressInput birthDate: Date educationGrade: EducationGrade