pull/20/head
adriano 2022-09-21 01:29:54 -03:00
parent 0e720ef48e
commit 728c5b580e
3 changed files with 26 additions and 21 deletions

View File

@ -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}%`)
// }
]
};
}

View File

@ -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}
/>
</div>

View File

@ -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'
},