feat(knowledge): update Project model, ProjectsApi sort, and NoteEditScreen noteType support

This commit is contained in:
2026-04-04 23:52:10 -04:00
parent f5ba2d25a3
commit a50193dbc0
4 changed files with 40 additions and 4 deletions
+7 -1
View File
@@ -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,