diff --git a/backend/src/services/TicketServices/ListTicketsService.ts b/backend/src/services/TicketServices/ListTicketsService.ts index c20154c..efe2ff0 100644 --- a/backend/src/services/TicketServices/ListTicketsService.ts +++ b/backend/src/services/TicketServices/ListTicketsService.ts @@ -88,19 +88,23 @@ const ListTicketsService = async ({ if (searchParam) { const sanitizedSearchParam = searchParam.toLocaleLowerCase().trim(); - includeCondition = [ - ...includeCondition, - { - model: Message, - as: "messages", - attributes: ["id", "body"], - where: { - body: where(fn("LOWER", col("body")), "LIKE", `%${sanitizedSearchParam}%`) - }, - required: false, - duplicating: false - } - ]; + //othavio + + console.log('sanitizedSearchParam:'+ sanitizedSearchParam, ' | sanitizedSearchParam.length: ',sanitizedSearchParam.length) + + // includeCondition = [ + // ...includeCondition, + // { + // model: Message, + // as: "messages", + // attributes: ["id", "body"], + // where: { + // body: where(fn("LOWER", col("body")), "LIKE", `%${sanitizedSearchParam}%`) + // }, + // required: false, + // duplicating: false + // } + // ]; whereCondition = { ...whereCondition, @@ -111,9 +115,9 @@ const ListTicketsService = async ({ { "$contact.number$": { [Op.like]: `%${sanitizedSearchParam}%` } }, - { - "$message.body$": where(fn("LOWER", col("body")), "LIKE", `%${sanitizedSearchParam}%`) - } + // { + // "$message.body$": where(fn("LOWER", col("body")), "LIKE", `%${sanitizedSearchParam}%`) + // } ] }; } diff --git a/frontend/src/components/TicketsManager/index.js b/frontend/src/components/TicketsManager/index.js index 3190905..e040530 100644 --- a/frontend/src/components/TicketsManager/index.js +++ b/frontend/src/components/TicketsManager/index.js @@ -124,7 +124,8 @@ const TicketsManager = () => { let searchTimeout; const handleSearch = (e) => { - const searchedTerm = e.target.value.toLowerCase().trim(); + let searchedTerm = e.target.value.toLowerCase() + clearTimeout(searchTimeout); @@ -136,7 +137,7 @@ const TicketsManager = () => { searchTimeout = setTimeout(() => { setSearchParam(searchedTerm); - }, 500); + }, 200); }; const handleChangeTab = (e, newValue) => { @@ -196,7 +197,7 @@ const TicketsManager = () => { className={classes.searchInput} inputRef={searchInputRef} placeholder={i18n.t("tickets.search.placeholder")} - type="search" + type="search" onChange={handleSearch} /> diff --git a/frontend/src/pages/Report/index.js b/frontend/src/pages/Report/index.js index 1c776a7..4030471 100644 --- a/frontend/src/pages/Report/index.js +++ b/frontend/src/pages/Report/index.js @@ -391,7 +391,7 @@ const Report = () => { const queryOnQueue = await apiBroker.get("/reports/status/query/onqueue", { params: { adminId: userA.id, - baseURL: process.env.REACT_APP_BACKEND_URL, + baseURL: process.env.REACT_APP_BACKEND_URL_PRIVATE, identifier: 'csv' } }); @@ -454,7 +454,7 @@ const Report = () => { { app: { adminId: userA.id, - baseURL: process.env.REACT_APP_BACKEND_URL, + baseURL: process.env.REACT_APP_BACKEND_URL_PRIVATE, frontURL: process.env.REACT_APP_FRONTEND_URL, identifier: 'csv' },