forge
Explore
Log in

Don't you dare go Hollow

Re-point subject callers + drop stale imports after bank merge

Browse files at this commit

4da5603be858f38c08d893eac5279eacb719c3b2Ahmet Kaan GümüşParent: 164e756
  • chore
    • re-point subject callers + drop stale imports after bank merge
Show full message
🧹 chore: re-point subject callers + drop stale imports after bank merge
src/db/bank_question.rsmodified+2 -2
@@ -631,11 +631,11 @@ mod tests {
631 let other_exam = crate::db::exam::published_exam(&db).await.get_id().clone();631 let other_exam = crate::db::exam::published_exam(&db).await.get_id().clone();
632 // A real subject row: an exam question claims a reference on its632 // A real subject row: an exam question claims a reference on its
633 // subject, so a minted id it never wrote would be refused.633 // subject, so a minted id it never wrote would be refused.
634- let subject = crate::domain::subject::Subject::create(634+ let subject = crate::db::subject::create(
635+ &db,
635 &crate::db::course::a_test_course(&db).await,636 &crate::db::course::a_test_course(&db).await,
636 crate::domain::subject::SubjectName::try_new("topic").unwrap(),637 crate::domain::subject::SubjectName::try_new("topic").unwrap(),
637 crate::domain::subject::SubjectDescription::try_new("").unwrap(),638 crate::domain::subject::SubjectDescription::try_new("").unwrap(),
638- &db,
639 )639 )
640 .await640 .await
641 .unwrap();641 .unwrap();
src/service/class_group.rsmodified+1 -1
@@ -5,7 +5,7 @@
5 use crate::database::Database;5 use crate::database::Database;
6 use crate::db::class_group;6 use crate::db::class_group;
7 use crate::domain::class_group::{ClassGrade, ClassGroup, ClassGroupId, ClassName};7 use crate::domain::class_group::{ClassGrade, ClassGroup, ClassGroupId, ClassName};
8-use crate::domain::term::{self, TermId};8+use crate::domain::term::TermId;
9 use crate::domain::user::UserId;9 use crate::domain::user::UserId;
10 use crate::error::AppError;10 use crate::error::AppError;
11 11
src/service/exam_result.rsmodified+0 -1
@@ -5,7 +5,6 @@
5 5
6 use crate::database::Database;6 use crate::database::Database;
7 use crate::db;7 use crate::db;
8-use crate::domain::badge;
9 use crate::domain::course::CourseId;8 use crate::domain::course::CourseId;
10 use crate::domain::exam::{Exam, ExamId};9 use crate::domain::exam::{Exam, ExamId};
11 use crate::domain::exam_result::{ExamResult, Mark};10 use crate::domain::exam_result::{ExamResult, Mark};
src/web/bank_questions.rsmodified+1 -1
@@ -651,7 +651,7 @@ async fn update_question(
651 owned_question(&st, &user, &bid).await?;651 owned_question(&st, &user, &bid).await?;
652 let patch = bank_question::BankQuestionPatch {652 let patch = bank_question::BankQuestionPatch {
653 subject: match req.subject_id {653 subject: match req.subject_id {
654- Some(ref subject_id) => Some(subject_must_exist(subject_id, &st.db).await?),654+ Some(ref subject_id) => Some(crate::service::subject::must_exist(&st.db, subject_id).await?),
655 None => None,655 None => None,
656 },656 },
657 text: match req.text {657 text: match req.text {
src/web/exams/mod.rsmodified+0 -1
@@ -13,7 +13,6 @@ use utoipa_axum::routes;
13 use crate::constant::{MAX_MAX_FILE_BYTES, UPLOAD_BODY_OVERHEAD_BYTES};13 use crate::constant::{MAX_MAX_FILE_BYTES, UPLOAD_BODY_OVERHEAD_BYTES};
14 use crate::database::Database;14 use crate::database::Database;
15 use crate::domain::answer_image::AnswerImage;15 use crate::domain::answer_image::AnswerImage;
16-use crate::domain::badge;
17 16
18 use crate::domain::exam::{17 use crate::domain::exam::{
19 Exam, ExamAttemptLimit, ExamDescription, ExamDuration, ExamId, ExamKind, ExamMode, ExamTitle,18 Exam, ExamAttemptLimit, ExamDescription, ExamDuration, ExamId, ExamKind, ExamMode, ExamTitle,