Refactor
This commit is contained in:
parent
28164c1db7
commit
b6e8e2dc9b
|
|
@ -39,7 +39,7 @@ class UserLoginRequest implements StartLoading {
|
|||
class UserLoginSuccess implements StopLoading {}
|
||||
|
||||
class UserLoginFailure implements StopLoading {
|
||||
final String error;
|
||||
final Object error;
|
||||
|
||||
UserLoginFailure(this.error);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ class AddClientSuccess implements StopLoading, PersistData, PersistUI {
|
|||
}
|
||||
|
||||
class SaveClientFailure implements StopLoading {
|
||||
final String error;
|
||||
final Object error;
|
||||
SaveClientFailure (this.error);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@ Middleware<AppState> _saveClient(ClientRepository repository) {
|
|||
.saveData(
|
||||
store.state.selectedCompany, store.state.authState, action.client)
|
||||
.then((dynamic client) {
|
||||
if (action.client.isNew()) {
|
||||
if (action.client.isNew) {
|
||||
store.dispatch(AddClientSuccess(client));
|
||||
} else {
|
||||
store.dispatch(SaveClientSuccess(client));
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ class AddInvoiceSuccess implements StopLoading, PersistData, PersistUI {
|
|||
}
|
||||
|
||||
class SaveInvoiceFailure implements StopLoading {
|
||||
final String error;
|
||||
final Object error;
|
||||
SaveInvoiceFailure (this.error);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -161,7 +161,7 @@ Middleware<AppState> _saveInvoice(InvoiceRepository repository) {
|
|||
.saveData(
|
||||
store.state.selectedCompany, store.state.authState, action.invoice)
|
||||
.then((dynamic invoice) {
|
||||
if (action.invoice.isNew()) {
|
||||
if (action.invoice.isNew) {
|
||||
store.dispatch(AddInvoiceSuccess(invoice));
|
||||
} else {
|
||||
store.dispatch(SaveInvoiceSuccess(invoice));
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ class AddProductSuccess implements StopLoading, PersistData, PersistUI {
|
|||
}
|
||||
|
||||
class SaveProductFailure implements StopLoading {
|
||||
final String error;
|
||||
final Object error;
|
||||
SaveProductFailure (this.error);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ Middleware<AppState> _saveProduct(ProductRepository repository) {
|
|||
.saveData(
|
||||
store.state.selectedCompany, store.state.authState, action.product)
|
||||
.then((dynamic product) {
|
||||
if (action.product.isNew()) {
|
||||
if (action.product.isNew) {
|
||||
store.dispatch(AddProductSuccess(product));
|
||||
} else {
|
||||
store.dispatch(SaveProductSuccess(product));
|
||||
|
|
|
|||
Loading…
Reference in New Issue