improvement: moved user data from localstorage to context

This commit is contained in:
canove
2021-01-13 08:08:25 -03:00
parent 2bec877e4f
commit 3aa287d394
23 changed files with 231 additions and 134 deletions

View File

@@ -1,6 +1,7 @@
import * as Yup from "yup";
import AppError from "../../errors/AppError";
import { SerializeUser } from "../../helpers/SerializeUser";
import User from "../../models/User";
interface Request {
@@ -63,13 +64,7 @@ const CreateUserService = async ({
await user.reload();
const serializedUser = {
id: user.id,
name: user.name,
email: user.email,
profile: user.profile,
queues: user.queues
};
const serializedUser = SerializeUser(user);
return serializedUser;
};