Rebase issues solved

This commit is contained in:
Manish 2025-11-17 11:32:07 +05:30
parent 2e750ad19c
commit 4900ce87f7
2 changed files with 14 additions and 32 deletions

View File

@ -1,8 +1,8 @@
class ApiEndpoints { 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://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://api.marcoaiot.com/api";
static const String baseUrl = "https://devapi.marcoaiot.com/api"; //static const String baseUrl = "https://devapi.marcoaiot.com/api";
static const String getMasterCurrencies = "/Master/currencies/list"; static const String getMasterCurrencies = "/Master/currencies/list";
static const String getMasterExpensesCategories = static const String getMasterExpensesCategories =

View File

@ -427,35 +427,22 @@ class ApiService {
} }
/// Get details of a single service project /// Get details of a single service project
static Future<ServiceProjectDetailModel?> getServiceProjectDetailApi(
String projectId) async {
final endpoint = "${ApiEndpoints.getServiceProjectDetail}/$projectId";
logSafe("Fetching details for Service Project ID: $projectId");
static Future<ServiceProjectDetailModel?> getServiceProjectDetailApi( static Future<ServiceProjectDetailModel?> getServiceProjectDetailApi(
String projectId) async { String projectId) async {
final endpoint = "${ApiEndpoints.getServiceProjectDetail}/$projectId"; final endpoint = "${ApiEndpoints.getServiceProjectDetail}/$projectId";
logSafe("Fetching details for Service Project ID: $projectId"); logSafe("Fetching details for Service Project ID: $projectId");
try {
final response = await _getRequest(endpoint);
try { try {
final response = await _getRequest(endpoint); final response = await _getRequest(endpoint);
if (response == null) { if (response == null) {
logSafe("Service Project Detail request failed: null response", logSafe(
level: LogLevel.error); "Service Project Detail request failed: null response",
return null; level: LogLevel.error,
}
if (response == null) {
logSafe("Service Project Detail request failed: null response",
level: LogLevel.error);
return null;
}
final jsonResponse = _parseResponseForAllData(
response,
label: "Service Project Detail",
); );
return null;
}
final jsonResponse = _parseResponseForAllData( final jsonResponse = _parseResponseForAllData(
response, response,
label: "Service Project Detail", label: "Service Project Detail",
@ -465,23 +452,18 @@ class ApiService {
return ServiceProjectDetailModel.fromJson(jsonResponse); return ServiceProjectDetailModel.fromJson(jsonResponse);
} }
} catch (e, stack) { } catch (e, stack) {
logSafe("Exception during getServiceProjectDetailApi: $e", logSafe(
level: LogLevel.error); "Exception during getServiceProjectDetailApi: $e",
logSafe("StackTrace: $stack", level: LogLevel.debug); level: LogLevel.error,
} );
if (jsonResponse != null) { logSafe(
return ServiceProjectDetailModel.fromJson(jsonResponse); "StackTrace: $stack",
} level: LogLevel.debug,
} catch (e, stack) { );
logSafe("Exception during getServiceProjectDetailApi: $e",
level: LogLevel.error);
logSafe("StackTrace: $stack", level: LogLevel.debug);
} }
return null; return null;
} }
return null;
}
/// Get Service Project List /// Get Service Project List
static Future<ServiceProjectListModel?> getServiceProjectsListApi({ static Future<ServiceProjectListModel?> getServiceProjectsListApi({