Professional Documents
Culture Documents
Message 1
Message 1
if (q) {
optionFilter = {
where: {
[Op.or]: []
}
};
let filterTitle = {
title: {
[Op.iLike]: `%${q}%`
}
}
let filterKeywords = {
keywords: {
[Op.iLike]: `%${q}%`
}
}
let filterSKU = {
sku: {
[Op.iLike]: `%${q}%`
}
}
let filterCategory = {
include: {
model: Category
}
}
if (category_ids) {
category_ids = category_ids.map((cat_id) => +cat_id)
filterCategory.include.where = {
id: {
[Op.in]: category_ids
}
}
}
const paginationInfo = {
totalItems: count,
totalPages,
currentPage: page,
nextPage,
prevPage,
items: items,
};