Corrigido problema ao renderizar VCards

Resolvido problema ao renderizar VCards.

Não consegui realizar a renderização de Multi_VCards mas deixei comentado a rotina quando for resolvido o problema de retornar body vazio ao enviar ou receber Multi_VCards
This commit is contained in:
Danilo Alves
2022-01-07 16:19:58 -03:00
parent d6efb23136
commit fec4f82957
9 changed files with 285 additions and 39 deletions

View File

@@ -0,0 +1,29 @@
import AppError from "../../errors/AppError";
import Contact from "../../models/Contact";
interface ExtraInfo {
name: string;
value: string;
}
interface Request {
name: string;
number: string;
email?: string;
profilePicUrl?: string;
extraInfo?: ExtraInfo[];
}
const GetContactService = async ({ name, number }: Request): Promise<Contact> => {
const numberExists = await Contact.findOne({
where: { number }
});
if (!numberExists) {
throw new AppError("CONTACT_NOT_FIND");
}
return numberExists;
};
export default GetContactService;