feat(knowledge): update Project model, ProjectsApi sort, and NoteEditScreen noteType support
This commit is contained in:
@@ -11,7 +11,11 @@ class ProjectsApi {
|
||||
try {
|
||||
final response = await _dio.get(
|
||||
'/api/projects',
|
||||
queryParameters: status != null ? {'status': status} : null,
|
||||
queryParameters: {
|
||||
'sort': 'updated_at',
|
||||
'order': 'desc',
|
||||
if (status != null) 'status': status,
|
||||
},
|
||||
);
|
||||
final data = response.data as Map<String, dynamic>;
|
||||
final list = data['projects'] as List<dynamic>;
|
||||
@@ -37,10 +41,12 @@ class ProjectsApi {
|
||||
String? description,
|
||||
String? goal,
|
||||
String? color,
|
||||
String status = 'active',
|
||||
}) async {
|
||||
try {
|
||||
final response = await _dio.post('/api/projects', data: {
|
||||
'title': title,
|
||||
'status': status,
|
||||
if (description != null && description.isNotEmpty)
|
||||
'description': description,
|
||||
if (goal != null && goal.isNotEmpty) 'goal': goal,
|
||||
|
||||
Reference in New Issue
Block a user