Correção da query por usuario no arquivo ShowTIcketReport.ts do backend
parent
a9d48b543d
commit
0ae0b0cf42
|
@ -8,9 +8,7 @@ import Message from "../../models/Message";
|
|||
import { userInfo } from "os";
|
||||
|
||||
//Report by user
|
||||
const ShowTicketReport = async (id: string | number): Promise<Ticket[]> => {
|
||||
|
||||
|
||||
const ShowTicketReport = async (id: string | number): Promise<Ticket[]> => {
|
||||
|
||||
const ticket = await Ticket.findAll({
|
||||
where: {userid: id} ,
|
||||
|
@ -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,
|
||||
model: Contact,
|
||||
attributes: ['name', 'number']
|
||||
},
|
||||
{
|
||||
model: User,
|
||||
required:true,
|
||||
model: User,
|
||||
attributes: ['name', 'email']
|
||||
},
|
||||
{
|
||||
model: Queue,
|
||||
required:true,
|
||||
model: Queue,
|
||||
attributes: ['name']
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in New Issue