diff --git a/backend/src/handlers/sources.rs b/backend/src/handlers/sources.rs index 0c276f7..67e38ab 100644 --- a/backend/src/handlers/sources.rs +++ b/backend/src/handlers/sources.rs @@ -324,5 +324,5 @@ pub async fn update_preferred( } db::sources::update_preferred(&state.pool, auth_user.id, &body.source_ids, body.theme_id).await?; - Ok(StatusCode::OK) + Ok(StatusCode::NO_CONTENT) } diff --git a/backend/tests/api_sources_preferred_test.rs b/backend/tests/api_sources_preferred_test.rs index e1aa8e4..b2f9f62 100644 --- a/backend/tests/api_sources_preferred_test.rs +++ b/backend/tests/api_sources_preferred_test.rs @@ -62,7 +62,7 @@ async fn update_preferred_sets_sources() { let (pref_status, _) = app .put_with_session("/api/v1/sources/preferred", &pref_body, &session) .await; - assert_eq!(pref_status, StatusCode::OK); + assert_eq!(pref_status, StatusCode::NO_CONTENT); // GET /sources → verify preferred flags let (list_status, list_body) = app @@ -132,7 +132,7 @@ async fn update_preferred_clears_all_when_empty() { let (pref_status, _) = app .put_with_session("/api/v1/sources/preferred", &pref_body, &session) .await; - assert_eq!(pref_status, StatusCode::OK); + assert_eq!(pref_status, StatusCode::NO_CONTENT); // Clear all preferred let clear_body = serde_json::json!({ diff --git a/backend/tests/pipeline_test.rs b/backend/tests/pipeline_test.rs index 8bf552e..a6ed0a1 100644 --- a/backend/tests/pipeline_test.rs +++ b/backend/tests/pipeline_test.rs @@ -638,7 +638,7 @@ async fn preferred_sources_processed_first() { let (pref_status, _) = app .put_with_session("/api/v1/sources/preferred", &pref_body, &session) .await; - assert_eq!(pref_status.as_u16(), 200, "Setting preferred sources should succeed"); + assert_eq!(pref_status.as_u16(), 204, "Setting preferred sources should succeed"); // Run the pipeline let mock_provider = MockLlmProvider::new() diff --git a/e2e/tests/sources.spec.ts b/e2e/tests/sources.spec.ts index 6ac050f..3f4f01f 100644 --- a/e2e/tests/sources.spec.ts +++ b/e2e/tests/sources.spec.ts @@ -132,7 +132,7 @@ test.describe('Sources management', () => { }); return { status: resp.status }; }, { ids: [sourceId2], tid: themeId }); - expect(prefResp.status).toBe(200); + expect(prefResp.status).toBe(204); // Step 9: Verify source is now preferred const listResp3 = await page.evaluate(async (tid: string) => {