diff --git a/lib/helpers/services/api_endpoints.dart b/lib/helpers/services/api_endpoints.dart index fae25cf..900d0c2 100644 --- a/lib/helpers/services/api_endpoints.dart +++ b/lib/helpers/services/api_endpoints.dart @@ -2,7 +2,8 @@ class ApiEndpoints { static const String baseUrl = "https://stageapi.marcoaiot.com/api"; // static const String baseUrl = "https://api.marcoaiot.com/api"; // static const String baseUrl = "https://devapi.marcoaiot.com/api"; - // static const String baseUrl = "https://mapi.marcoaiot.com/api"; + // static const String baseUrl = "https://mapi.marcoaiot.com/api"; + static const String getMasterCurrencies = "/Master/currencies/list"; static const String getMasterExpensesCategories = diff --git a/lib/helpers/services/api_service.dart b/lib/helpers/services/api_service.dart index e148861..4340118 100644 --- a/lib/helpers/services/api_service.dart +++ b/lib/helpers/services/api_service.dart @@ -310,8 +310,7 @@ class ApiService { /// Edit a Service Project Job static Future editServiceProjectJobApi({ required String jobId, - required List> - operations, + required List> operations, }) async { final endpoint = "${ApiEndpoints.editServiceProjectJob}/$jobId"; @@ -505,35 +504,20 @@ class ApiService { } /// Get details of a single service project - static Future getServiceProjectDetailApi( - String projectId) async { - final endpoint = "${ApiEndpoints.getServiceProjectDetail}/$projectId"; - logSafe("Fetching details for Service Project ID: $projectId"); static Future getServiceProjectDetailApi( String projectId) async { final endpoint = "${ApiEndpoints.getServiceProjectDetail}/$projectId"; logSafe("Fetching details for Service Project ID: $projectId"); - try { - final response = await _getRequest(endpoint); try { final response = await _getRequest(endpoint); - if (response == null) { - logSafe("Service Project Detail request failed: null response", - level: LogLevel.error); - return null; - } if (response == null) { logSafe("Service Project Detail request failed: null response", level: LogLevel.error); return null; } - final jsonResponse = _parseResponseForAllData( - response, - label: "Service Project Detail", - ); final jsonResponse = _parseResponseForAllData( response, label: "Service Project Detail", @@ -547,19 +531,9 @@ class ApiService { level: LogLevel.error); logSafe("StackTrace: $stack", level: LogLevel.debug); } - if (jsonResponse != null) { - return ServiceProjectDetailModel.fromJson(jsonResponse); - } - } catch (e, stack) { - logSafe("Exception during getServiceProjectDetailApi: $e", - level: LogLevel.error); - logSafe("StackTrace: $stack", level: LogLevel.debug); - } return null; } - return null; - } /// Get Service Project List static Future getServiceProjectsListApi({