Test
parent
0e720ef48e
commit
728c5b580e
|
@ -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}%`)
|
||||
// }
|
||||
]
|
||||
};
|
||||
}
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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'
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue