feat: handle group messages

This commit is contained in:
canove
2020-09-30 19:16:31 -03:00
parent 3a777dec39
commit 4c67067d8f
15 changed files with 138 additions and 68 deletions

View File

@@ -2,13 +2,13 @@ import Contact from "../../models/Contact";
import AppError from "../../errors/AppError";
const ShowContactService = async (id: string | number): Promise<Contact> => {
const user = await Contact.findByPk(id, { include: ["extraInfo"] });
const contact = await Contact.findByPk(id, { include: ["extraInfo"] });
if (!user) {
if (!contact) {
throw new AppError("No contact found with this ID.", 404);
}
return user;
return contact;
};
export default ShowContactService;