completed migrating data scope from user to workspace
This commit is contained in:
@@ -38,14 +38,17 @@ class AccountProvider extends ChangeNotifier {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
Future<ApiResponse<AccountModel>> fetchAccount(String phoneNumber) async {
|
||||
Future<ApiResponse<AccountModel>> fetchAccount(
|
||||
String? workspaceId,
|
||||
String currency,
|
||||
) async {
|
||||
_isLoadingAccount = true;
|
||||
_accountError = null;
|
||||
notifyListeners();
|
||||
|
||||
try {
|
||||
Map<String, dynamic> response = await http.get(
|
||||
'/accounts/phone/$phoneNumber',
|
||||
'/accounts/$workspaceId/balance/$currency',
|
||||
);
|
||||
|
||||
_account = AccountModel.fromJson(response);
|
||||
@@ -69,7 +72,8 @@ class AccountProvider extends ChangeNotifier {
|
||||
}
|
||||
|
||||
Future<ApiResponse<StatementModel>> fetchStatement({
|
||||
required String phoneNumber,
|
||||
required String workspaceId,
|
||||
required String currency,
|
||||
required String startDate,
|
||||
required String endDate,
|
||||
}) async {
|
||||
@@ -79,7 +83,7 @@ class AccountProvider extends ChangeNotifier {
|
||||
|
||||
try {
|
||||
Map<String, dynamic> response = await http.get(
|
||||
'/accounts/phone/$phoneNumber/statement'
|
||||
'/accounts/$workspaceId/statement/$currency'
|
||||
'?startDate=$startDate&endDate=$endDate',
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user