From 68ed97b64a87a7cb134d0bf68a5d62dbf3a7ec32 Mon Sep 17 00:00:00 2001 From: Manish Date: Mon, 17 Nov 2025 11:32:07 +0530 Subject: [PATCH] Rebase issues solved --- lib/helpers/services/api_endpoints.dart | 2 +- lib/helpers/services/api_service.dart | 34 +++++++++---------------- 2 files changed, 13 insertions(+), 23 deletions(-) diff --git a/lib/helpers/services/api_endpoints.dart b/lib/helpers/services/api_endpoints.dart index 203b936..fae25cf 100644 --- a/lib/helpers/services/api_endpoints.dart +++ b/lib/helpers/services/api_endpoints.dart @@ -1,5 +1,5 @@ class ApiEndpoints { - // static const String baseUrl = "https://stageapi.marcoaiot.com/api"; + 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"; diff --git a/lib/helpers/services/api_service.dart b/lib/helpers/services/api_service.dart index b7985c6..d374a78 100644 --- a/lib/helpers/services/api_service.dart +++ b/lib/helpers/services/api_service.dart @@ -504,10 +504,6 @@ 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"; @@ -517,13 +513,10 @@ class ApiService { 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); + logSafe( + "Service Project Detail request failed: null response", + level: LogLevel.error, + ); return null; } @@ -536,17 +529,14 @@ class ApiService { return ServiceProjectDetailModel.fromJson(jsonResponse); } } catch (e, stack) { - logSafe("Exception during getServiceProjectDetailApi: $e", - 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); + logSafe( + "Exception during getServiceProjectDetailApi: $e", + level: LogLevel.error, + ); + logSafe( + "StackTrace: $stack", + level: LogLevel.debug, + ); } return null;