feat(knowledge): add ProjectsScreen and ProjectEditScreen, sort projects by updated_at
This commit is contained in:
@@ -7,13 +7,17 @@ class ProjectsApi {
|
||||
final Dio _dio;
|
||||
const ProjectsApi(this._dio);
|
||||
|
||||
Future<List<Project>> getAll({String? status}) async {
|
||||
Future<List<Project>> getAll({
|
||||
String? status,
|
||||
String sort = 'updated_at',
|
||||
String order = 'desc',
|
||||
}) async {
|
||||
try {
|
||||
final response = await _dio.get(
|
||||
'/api/projects',
|
||||
queryParameters: {
|
||||
'sort': 'updated_at',
|
||||
'order': 'desc',
|
||||
'sort': sort,
|
||||
'order': order,
|
||||
if (status != null) 'status': status,
|
||||
},
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user