mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-20 20:59:16 +00:00
fix: user profile not updating
This commit is contained in:
@@ -38,13 +38,14 @@ const UpdateUserService = async ({
|
|||||||
const schema = Yup.object().shape({
|
const schema = Yup.object().shape({
|
||||||
name: Yup.string().min(2),
|
name: Yup.string().min(2),
|
||||||
email: Yup.string().email(),
|
email: Yup.string().email(),
|
||||||
|
profile: Yup.string(),
|
||||||
password: Yup.string()
|
password: Yup.string()
|
||||||
});
|
});
|
||||||
|
|
||||||
const { email, password, name } = userData;
|
const { email, password, profile, name } = userData;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await schema.validate({ email, password, name });
|
await schema.validate({ email, password, profile, name });
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
throw new AppError(err.message);
|
throw new AppError(err.message);
|
||||||
}
|
}
|
||||||
@@ -52,6 +53,7 @@ const UpdateUserService = async ({
|
|||||||
await user.update({
|
await user.update({
|
||||||
email,
|
email,
|
||||||
password,
|
password,
|
||||||
|
profile,
|
||||||
name
|
name
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user