feat: Add getGlobalProjects method and update project fetching logic
This commit is contained in:
parent
916cfa3af4
commit
8e47d28005
@ -46,7 +46,7 @@ class ProjectController extends GetxController {
|
||||
isLoadingProjects.value = true;
|
||||
isLoading.value = true;
|
||||
|
||||
final response = await ApiService.getProjects();
|
||||
final response = await ApiService.getGlobalProjects();
|
||||
|
||||
if (response != null && response.isNotEmpty) {
|
||||
projects.assignAll(
|
||||
|
@ -4,6 +4,7 @@ class ApiEndpoints {
|
||||
|
||||
// Attendance Screen API Endpoints
|
||||
static const String getProjects = "/project/list";
|
||||
static const String getGlobalProjects = "/project/list/basic";
|
||||
static const String getEmployeesByProject = "/attendance/project/team";
|
||||
static const String getAttendanceLogs = "/attendance/project/log";
|
||||
static const String getAttendanceLogView = "/attendance/log/attendance";
|
||||
|
@ -129,7 +129,12 @@ class ApiService {
|
||||
? _parseResponse(response, label: 'Projects')
|
||||
: null;
|
||||
}
|
||||
|
||||
static Future<List<dynamic>?> getGlobalProjects() async {
|
||||
final response = await _getRequest(ApiEndpoints.getProjects);
|
||||
return response != null
|
||||
? _parseResponse(response, label: 'Global Projects')
|
||||
: null;
|
||||
}
|
||||
static Future<List<dynamic>?> getEmployeesByProject(String projectId) async {
|
||||
final response = await _getRequest(ApiEndpoints.getEmployeesByProject,
|
||||
queryParams: {"projectId": projectId});
|
||||
|
Loading…
x
Reference in New Issue
Block a user