summaryrefslogtreecommitdiff
path: root/src/api
diff options
context:
space:
mode:
authorIT Fixcomart <it@fixcomart.co.id>2024-07-04 04:11:13 +0000
committertrisusilo <tri.susilo@altama.co.id>2024-07-04 04:11:13 +0000
commit104488aea14545d8aef9c7f3821fc479072a3e64 (patch)
treef6a6014235ff0b669d07a0d59b9279108a4284f9 /src/api
parentf7aef936d5c913d110fb1419dc2f4f756dd34df7 (diff)
parent7dd4985e667292d79803c5e1de3a11ba42665f4b (diff)
Merged in Feature/iman-sequence (pull request #150)
<iman> add feature sequence promotion program Approved-by: trisusilo
Diffstat (limited to 'src/api')
-rw-r--r--src/api/promoApi.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/api/promoApi.js b/src/api/promoApi.js
index 4c386fba..55067d21 100644
--- a/src/api/promoApi.js
+++ b/src/api/promoApi.js
@@ -15,11 +15,12 @@ export const fetchPromoItems = async (type) => {
export const fetchPromoItemsSolr = async (type) => {
// let query = type ? `type_value_s:${type}` : '*:*';
+ let sort ='sort=if(exists(sequence_i),0,1) asc,sequence_i asc, if(exists(image_s),0,1) asc ';
let start = 0
- let rows = 100
+ let rows = 120
try {
const queryParams = new URLSearchParams({ q: type });
- const response = await fetch(`/solr/promotion_program_lines/select?${queryParams.toString()}&rows=${rows}&start=${start}`);
+ const response = await fetch(`/solr/promotion_program_lines/select?${queryParams.toString()}&rows=${rows}&start=${start}&${sort}`);
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}
@@ -59,6 +60,7 @@ const map = async (promotions) => {
limit_user: promotion.package_limit_user_i,
limit_trx: promotion.package_limit_trx_i,
price: promotion.price_f,
+ sequence: promotion.sequence_i,
total_qty: promotion.total_qty_i,
products: JSON.parse(promotion.products_s),
product_id: promotion.product_ids[0],