mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-18 11:49:19 +00:00
improvement: added types to ListTicketService
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Op, fn, where, col } from "sequelize";
|
||||
import { Op, fn, where, col, Filterable, Includeable } from "sequelize";
|
||||
import { startOfDay, endOfDay, parseISO } from "date-fns";
|
||||
|
||||
import Ticket from "../../models/Ticket";
|
||||
@@ -28,8 +28,8 @@ const ListTicketsService = async ({
|
||||
showAll,
|
||||
userId
|
||||
}: Request): Promise<Response> => {
|
||||
let whereCondition = {};
|
||||
let includeCondition = [];
|
||||
let whereCondition: Filterable["where"];
|
||||
let includeCondition: Includeable[];
|
||||
|
||||
includeCondition = [
|
||||
{
|
||||
@@ -97,7 +97,7 @@ const ListTicketsService = async ({
|
||||
whereCondition = {
|
||||
...whereCondition,
|
||||
createdAt: {
|
||||
[Op.between]: [startOfDay(parseISO(date)), endOfDay(parseISO(date))]
|
||||
[Op.between]: [+startOfDay(parseISO(date)), +endOfDay(parseISO(date))]
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user