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;
|
isLoadingProjects.value = true;
|
||||||
isLoading.value = true;
|
isLoading.value = true;
|
||||||
|
|
||||||
final response = await ApiService.getProjects();
|
final response = await ApiService.getGlobalProjects();
|
||||||
|
|
||||||
if (response != null && response.isNotEmpty) {
|
if (response != null && response.isNotEmpty) {
|
||||||
projects.assignAll(
|
projects.assignAll(
|
||||||
|
|||||||
@ -4,6 +4,7 @@ class ApiEndpoints {
|
|||||||
|
|
||||||
// Attendance Screen API Endpoints
|
// Attendance Screen API Endpoints
|
||||||
static const String getProjects = "/project/list";
|
static const String getProjects = "/project/list";
|
||||||
|
static const String getGlobalProjects = "/project/list/basic";
|
||||||
static const String getEmployeesByProject = "/attendance/project/team";
|
static const String getEmployeesByProject = "/attendance/project/team";
|
||||||
static const String getAttendanceLogs = "/attendance/project/log";
|
static const String getAttendanceLogs = "/attendance/project/log";
|
||||||
static const String getAttendanceLogView = "/attendance/log/attendance";
|
static const String getAttendanceLogView = "/attendance/log/attendance";
|
||||||
|
|||||||
@ -129,7 +129,12 @@ class ApiService {
|
|||||||
? _parseResponse(response, label: 'Projects')
|
? _parseResponse(response, label: 'Projects')
|
||||||
: null;
|
: 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 {
|
static Future<List<dynamic>?> getEmployeesByProject(String projectId) async {
|
||||||
final response = await _getRequest(ApiEndpoints.getEmployeesByProject,
|
final response = await _getRequest(ApiEndpoints.getEmployeesByProject,
|
||||||
queryParams: {"projectId": projectId});
|
queryParams: {"projectId": projectId});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user