Correção da query por usuario no arquivo ShowTIcketReport.ts do backend

pull/1/head
adriano 2022-01-15 16:00:55 -03:00
parent a9d48b543d
commit 0ae0b0cf42
1 changed files with 5 additions and 10 deletions

View File

@ -10,8 +10,6 @@ import { userInfo } from "os";
//Report by user
const ShowTicketReport = async (id: string | number): Promise<Ticket[]> => {
const ticket = await Ticket.findAll({
where: {userid: id} ,
attributes: ['id', 'status', 'createdAt', 'updatedAt'],
@ -20,24 +18,21 @@ const ShowTicketReport = async (id: string | number): Promise<Ticket[]> => {
model: Message,
required:true,
separate: true,
attributes: ['body', 'read', 'mediaType', 'mediaUrl','createdAt'],
attributes: ['body', 'read', 'mediaType','fromMe', 'mediaUrl','createdAt'],
order: [
['createdAt', 'ASC']
]
},
{
model: Contact,
required:true,
attributes: ['name', 'number']
},
{
model: User,
required:true,
attributes: ['name', 'email']
},
{
model: Queue,
required:true,
attributes: ['name']
},