mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-19 20:29:17 +00:00
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:
29
backend/src/services/ContactServices/GetContactService.ts
Normal file
29
backend/src/services/ContactServices/GetContactService.ts
Normal 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;
|
||||
Reference in New Issue
Block a user