Skip to content

Commit 6e676f3

Browse files
docs: updated docs for the query filter
1 parent 56a61cb commit 6e676f3

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

backend/src/db/queries.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,10 @@ pub fn get_all_unapproved_query() -> String {
103103

104104
/// Returns the query for searching question papers. It is mostly voodoo, see [blog post](https://rajivharlalka.in/posts/iqps-search-development/).
105105
///
106-
/// Optionally, the `exam` argument can be used to also add a clause to match the exam field.
106+
/// The `exam_filter` argument is a vector of exam types to filter. Pass empty vector to disable the filter.
107107
///
108108
/// Query parameters:
109109
/// $1 - Search query
110-
/// $2 - Exam filter string (can be midsem, endsem, midend, or ct)
111110
///
112111
/// Returns the query and a boolean representing whether the second argument is required
113112
pub fn get_qp_search_query(exam_filter: Vec<Exam>) -> String {

backend/src/routing/handlers.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ pub async fn get_unapproved(
5757
///
5858
/// # Request Query Parameters
5959
/// * `query`: The query string to search in the question papers (searches course name or code)
60-
/// * `exam` (optional): A filter for the question paper by the exam field.
60+
/// * `exam` (optional): A comma-separated string of exam types to filter. Leave empty to match any exam.
6161
pub async fn search(
6262
State(state): State<RouterState>,
6363
Query(params): Query<HashMap<String, String>>,

0 commit comments

Comments
 (0)