fix filited produvts API

merge-requests/544/head
hussam al-habibeh 4 years ago
parent 7607631052
commit e6fd5293ca

@ -5,6 +5,7 @@ import 'package:diplomaticquarterapp/core/model/pharmacy/categorise_parent_model
import 'package:diplomaticquarterapp/core/model/pharmacy/final_products_model.dart';
import 'package:diplomaticquarterapp/core/model/pharmacy/pharmacy_categorise.dart';
import 'package:diplomaticquarterapp/core/model/pharmacy/scan_qr_model.dart';
import 'package:diplomaticquarterapp/models/LiveCare/validators.dart';
import 'base_service.dart';
@ -303,9 +304,9 @@ class PharmacyCategoriseService extends BaseService {
_parentProductsList.clear();
endPoint = FILTERED_PRODUCTS +
"$categoryId" +
"&manufacturerids=$brandId" +
"&price_min=$min" +
"&price_max=$max&page=1&limit=50";
"$brandId" +
"$min" +
"$max&page=1&limit=50";
await baseAppClient.getPharmacy(
endPoint,
onSuccess: (dynamic response, int statusCode) {
@ -328,9 +329,9 @@ class PharmacyCategoriseService extends BaseService {
_subProductsList.clear();
endPoint = FILTERED_PRODUCTS +
"$categoryId" +
"&manufacturerids=$brandId" +
"&price_min=$min" +
"&price_max=$max&page=1&limit=50";
"$brandId" +
"$min" +
"$max&page=1&limit=50";
await baseAppClient.getPharmacy(
endPoint,
onSuccess: (dynamic response, int statusCode) {

@ -610,10 +610,10 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
context);
await model.getFilteredProducts(
min: minField.text.toString(),
max: maxField.text.toString(),
min: minField.text.isEmpty ? "" : "&price_min=" + minField.text.toString(),
max: maxField.text.isEmpty ? "" : "&price_max=" + maxField.text.toString(),
categoryId: categoriesId,
brandId: brandIds);
brandId: brandIds.isEmpty ? "" : "&manufacturerids=" + brandIds);
GifLoaderDialogUtils.hideDialog(
context);

@ -643,16 +643,20 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
context);
await model.getFilteredSubProducts(
min: minField
.text
.toString(),
max: maxField
.text
.toString(),
min: minField.text.isEmpty
? ""
: minField.text
.toString(),
max: maxField.text.isEmpty
? ""
: maxField.text
.toString(),
categoryId:
categoriesId,
brandId:
brandIds);
brandId: brandIds.isEmpty
? ""
: "&manufacturerids=" +
brandIds);
GifLoaderDialogUtils
.hideDialog(
context);

Loading…
Cancel
Save