fix as first step

merge-requests/542/head
Elham Rababh 4 years ago
parent 6439fe264a
commit 12e47aba82

@ -544,8 +544,8 @@ const SUBSCRIBE_PRODUCT = "subscribe?";
const GET_ORDER = "orders?"; const GET_ORDER = "orders?";
const GET_ORDER_DETAILS = "orders/"; const GET_ORDER_DETAILS = "orders/";
const ADD_CUSTOMER_ADDRESS = "addcustomeraddress"; const ADD_CUSTOMER_ADDRESS = "addcustomeraddress";
const EDIT_CUSTOMER_ADDRESS = "epharmacy/api/editcustomeraddress"; const EDIT_CUSTOMER_ADDRESS = "editcustomeraddress";
const DELETE_CUSTOMER_ADDRESS = "epharmacy/api/deletecustomeraddress"; const DELETE_CUSTOMER_ADDRESS = "deletecustomeraddress";
const GET_ADDRESS = "Customers/"; const GET_ADDRESS = "Customers/";
const GET_Cancel_ORDER = "cancelorder/"; const GET_Cancel_ORDER = "cancelorder/";
const WRITE_REVIEW = "Content-Type" + "text/plain; charset=utf-8"; const WRITE_REVIEW = "Content-Type" + "text/plain; charset=utf-8";

@ -65,12 +65,12 @@ class CustomerAddressesService extends BaseService {
class CustomerInfo { class CustomerInfo {
bool isRegistered; bool isRegistered;
String userName; dynamic userName;
dynamic password; dynamic password;
String email; dynamic email;
dynamic errorMessage; dynamic errorMessage;
String mobileNumber; dynamic mobileNumber;
int customerId; dynamic customerId;
CustomerInfo({this.isRegistered, this.userName, this.password, this.email, this.errorMessage, this.mobileNumber, this.customerId}); CustomerInfo({this.isRegistered, this.userName, this.password, this.email, this.errorMessage, this.mobileNumber, this.customerId});
@ -103,7 +103,7 @@ class AddressInfo {
String lastName; String lastName;
String email; String email;
dynamic company; dynamic company;
int countryId; dynamic countryId;
String country; String country;
dynamic stateProvinceId; dynamic stateProvinceId;
String city; String city;

@ -75,7 +75,6 @@ class PharmacyAddressesViewModel extends BaseViewModel {
sendingAddress.faxNumber = user.faxNumber; sendingAddress.faxNumber = user.faxNumber;
sendingAddress.customerAttributes = ""; sendingAddress.customerAttributes = "";
sendingAddress.createdOnUtc = DateTime.now().toString(); sendingAddress.createdOnUtc = DateTime.now().toString();
if (editedAddress == null) { if (editedAddress == null) {
///TODO Fatima* ///TODO Fatima*
@ -83,15 +82,21 @@ class PharmacyAddressesViewModel extends BaseViewModel {
} else { } else {
await _pharmacyAddressService.editCustomerAddress(sendingAddress); await _pharmacyAddressService.editCustomerAddress(sendingAddress);
} }
if (_pharmacyAddressService.hasError) { if (_pharmacyAddressService.hasError) {
error = _pharmacyAddressService.error; await _pharmacyAddressService.getAddresses();
Utils.showErrorToast(error); setState(ViewState.Idle);
setState(ViewState.Error);
// setState(ViewState.Error);
} else { } else {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
} }
Future deleteAddresses(AddressInfo sendingAddress) async { Future deleteAddresses(AddressInfo sendingAddress) async {

@ -34,9 +34,11 @@ class _PharmacyAddressesState extends State<PharmacyAddressesPage> {
Navigator.push( Navigator.push(
ctx, ctx,
FadePage( FadePage(
page: AddAddressPage(address, (pickResult) { page: AddAddressPage(address, (pickResult) async {
model.addEditAddress(pickResult, address); model.addEditAddress(pickResult, address);
}))); await model.getAddressesList();
})));
} }
Widget build(BuildContext context) { Widget build(BuildContext context) {

@ -71,7 +71,10 @@ class PharmacyAddressService extends BaseService {
} }
Future addCustomerAddress(AddressInfo address) async { Future addCustomerAddress(AddressInfo address) async {
makeCustomerAddress(address, ADD_CUSTOMER_ADDRESS); await makeCustomerAddress(address, ADD_CUSTOMER_ADDRESS);
// if(!hasError) {
selectedAddressIndex = addresses.length +1;
// }
} }
Future editCustomerAddress(AddressInfo address) async { Future editCustomerAddress(AddressInfo address) async {

Loading…
Cancel
Save