fix: classification results empty and res.data access issues

Backend:
- Add GET /classifications/results endpoint with project/level/keyword filters
- Add column relationship to ClassificationResult model
- Fix test data generator to fetch column IDs from DB after bulk insert

Frontend:
- Fix request.ts interceptor to return full response body (keep total/pagination)
- Fix all pages to use res.data instead of res
- Add getClassificationResults API in classification.ts
- Implement fetchData in Classification.vue with proper filtering and pagination
- Fix same res.data issue in Category.vue, Metadata.vue, Project.vue, DataSource.vue, Dashboard.vue, Task.vue
This commit is contained in:
hiderfong
2026-04-23 10:46:51 +08:00
parent 4b08bb5057
commit 5119ca775b
9 changed files with 100 additions and 20 deletions
+3 -1
View File
@@ -417,7 +417,9 @@ print(f" Created {len(projects)} projects")
# ============================================================
print("Generating classification results...")
all_col_ids = [c.id for c in all_columns]
# Re-fetch column IDs from DB since bulk_save_objects doesn't populate object IDs
col_rows = db.query(DataColumn.id).all()
all_col_ids = [c[0] for c in col_rows]
random.shuffle(all_col_ids)
result_batch = []