enabled socket events on contact controller

This commit is contained in:
canove
2020-09-20 11:47:46 -03:00
parent a879bb95ca
commit 23d16679b6
2 changed files with 20 additions and 18 deletions

View File

@@ -16,8 +16,8 @@ interface Request {
const CreateContactService = async ({
name,
number,
email,
extraInfo
email = "",
extraInfo = []
}: Request): Promise<Contact> => {
const numberExists = await Contact.findOne({
where: { number }
@@ -27,6 +27,8 @@ const CreateContactService = async ({
throw new AppError("A contact with this number already exists.");
}
console.log("extra", extraInfo);
const contact = await Contact.create(
{
name,