fix filited produvts API

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

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

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

Loading…
Cancel
Save