diff --git a/src/services/profile.service.ts b/src/services/profile.service.ts index 42c74e0..95c8acd 100644 --- a/src/services/profile.service.ts +++ b/src/services/profile.service.ts @@ -16,13 +16,14 @@ export const updateProfile = async ( try { const profileRepository = dataSource.getRepository(Profile) - const updatedFields: Partial = {} + const { primary_email, first_name, last_name, image_url } = updateData - if (updateData.primary_email) - updatedFields.primary_email = updateData.primary_email - if (updateData.first_name) updatedFields.first_name = updateData.first_name - if (updateData.last_name) updatedFields.last_name = updateData.last_name - if (updateData.image_url) updatedFields.image_url = updateData.image_url + const updatedFields: Partial = { + primary_email, + first_name, + last_name, + image_url + } await profileRepository.update( { uuid: user.uuid },