From f55e336b38453e0b4d49875398b507483afd35d7 Mon Sep 17 00:00:00 2001 From: canove Date: Thu, 5 Nov 2020 17:04:17 -0300 Subject: [PATCH] fix: user profile not updating --- backend/src/services/UserServices/UpdateUserService.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/backend/src/services/UserServices/UpdateUserService.ts b/backend/src/services/UserServices/UpdateUserService.ts index b0c497b..e548645 100644 --- a/backend/src/services/UserServices/UpdateUserService.ts +++ b/backend/src/services/UserServices/UpdateUserService.ts @@ -38,13 +38,14 @@ const UpdateUserService = async ({ const schema = Yup.object().shape({ name: Yup.string().min(2), email: Yup.string().email(), + profile: Yup.string(), password: Yup.string() }); - const { email, password, name } = userData; + const { email, password, profile, name } = userData; try { - await schema.validate({ email, password, name }); + await schema.validate({ email, password, profile, name }); } catch (err) { throw new AppError(err.message); } @@ -52,6 +53,7 @@ const UpdateUserService = async ({ await user.update({ email, password, + profile, name });