From ce61c8b7d0bbb5c1124c1435c8fc8720cc426af8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=98=BF=E7=94=B7?= Date: Fri, 1 May 2026 00:42:09 +0800 Subject: [PATCH] fix: prioritize student branch when both student_id and teacher_id present The daka query branching checked teacher_id first. When a student has currentTeacherId set, both params are present, causing the teacher branch to activate (requires scope) and fail with "scope can not be none". Fixed by adding student_id.is_none() to the teacher branch condition. Co-Authored-By: Claude Opus 4.7 --- htyws/src/ws_daka.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htyws/src/ws_daka.rs b/htyws/src/ws_daka.rs index a7ef3ea..49c31ee 100644 --- a/htyws/src/ws_daka.rs +++ b/htyws/src/ws_daka.rs @@ -855,7 +855,7 @@ pub async fn raw_find_dakas_with_sections_by_user_id( let dakas_with_pages: (Vec, i64, i64); let dakas: Vec; - if teacher_id.is_some() { + if teacher_id.is_some() && student_id.is_none() { match scope { &Some(string_ref) => match string_ref.as_str() { "ALL" => {