From 3273d5b32857de4a029d2f1fd71f6dfcf73dd914 Mon Sep 17 00:00:00 2001 From: "Mr.Jebelli" Date: Sat, 28 Feb 2026 10:37:01 +0330 Subject: [PATCH] fixed report --- lib/data/repository/auth_repository.dart | 25 ++++++++++-------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/lib/data/repository/auth_repository.dart b/lib/data/repository/auth_repository.dart index 965026f..7380405 100644 --- a/lib/data/repository/auth_repository.dart +++ b/lib/data/repository/auth_repository.dart @@ -144,10 +144,8 @@ class AuthRepository { final shamsiMounth = startDate.month; startDate = Jalali(shamsiYear, shamsiMounth, 1); - Jalali endDate = Jalali( - shamsiMounth == 12 ? shamsiYear + 1 : shamsiYear, - shamsiMounth == 12 ? 1 : shamsiMounth + 1, - 1) + Jalali endDate = Jalali(shamsiMounth == 12 ? shamsiYear + 1 : shamsiYear, + shamsiMounth == 12 ? 1 : shamsiMounth + 1, 1) .addDays(-1); Gregorian sMiladiDate = startDate.toGregorian(); Gregorian eMiladiDate = endDate.toGregorian(); @@ -173,10 +171,8 @@ class AuthRepository { final shamsiMounth = startDate.month; startDate = Jalali(shamsiYear, shamsiMounth, 1); - Jalali endDate = Jalali( - shamsiMounth == 12 ? shamsiYear + 1 : shamsiYear, - shamsiMounth == 12 ? 1 : shamsiMounth + 1, - 1) + Jalali endDate = Jalali(shamsiMounth == 12 ? shamsiYear + 1 : shamsiYear, + shamsiMounth == 12 ? 1 : shamsiMounth + 1, 1) .addDays(-1); Gregorian sMiladiDate = startDate.toGregorian(); @@ -218,8 +214,8 @@ class AuthRepository { static Future addSubUser(String mobileNumber, int level) async { try { - final number = mobileNumber.convertToEnglishNumber(); - + final number = mobileNumber.convertToEnglishNumber(); + Response response = await _dioService.sendRequest().post( DioService.addSubUser, data: { @@ -246,12 +242,13 @@ class AuthRepository { static Future>> getSubUsers() async { try { - Response response = await _dioService.sendRequest().get(DioService.getSubUsers); - + Response response = + await _dioService.sendRequest().get(DioService.getSubUsers); + // استخراج لیست کاربران از پاسخ جیسون // ساختار: { "sub_users": [...], "total_count": 1 } List data = response.data['sub_users']; - + // تبدیل به لیستی از Mapها return List>.from(data); } catch (ex) { @@ -259,5 +256,3 @@ class AuthRepository { } } } - -