mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-19 12:19:16 +00:00
changed ticket creation and list to typescript
This commit is contained in:
@@ -16,6 +16,16 @@ const ListContactsService = async ({
|
||||
searchParam = "",
|
||||
pageNumber = "1"
|
||||
}: Request): Promise<Response> => {
|
||||
let includeCondition = [
|
||||
{
|
||||
model: Contact,
|
||||
as: "contact",
|
||||
attributes: ["name", "number", "profilePicUrl"]
|
||||
}
|
||||
];
|
||||
|
||||
// let whereCondition = {};
|
||||
|
||||
const whereCondition = {
|
||||
[Op.or]: [
|
||||
{
|
||||
@@ -33,6 +43,7 @@ const ListContactsService = async ({
|
||||
|
||||
const { count, rows: contacts } = await Contact.findAndCountAll({
|
||||
where: whereCondition,
|
||||
include: includeCondition,
|
||||
limit,
|
||||
offset,
|
||||
order: [["createdAt", "DESC"]]
|
||||
|
||||
Reference in New Issue
Block a user