feat: Add previous winners field to hackathon schema and update related tests

This commit is contained in:
MythEclipse
2025-09-27 22:30:42 +07:00
parent af41a98111
commit a32f54873b
10 changed files with 128 additions and 20 deletions
@@ -266,7 +266,7 @@ impl<'a> HackathonRepository<'a> {
let builder = QueryListBuilder::new(&self.state.surrealdb_ws, &table, &meta)
.with_condition("is_deleted = false")
.with_condition(&format!("hackathon_id = app_hackathons:{}", hackathon_id))
.with_condition(&format!("hackathon_id = type::thing('app_hackathons', '{}')", hackathon_id))
.search_field("title")
.select_fields(vec!["*"]);
@@ -394,7 +394,7 @@ impl<'a> HackathonRepository<'a> {
let builder = QueryListBuilder::new(&self.state.surrealdb_ws, &table, &meta)
.with_condition("is_deleted = false")
.with_condition(&format!("hackathon_id = app_hackathons:{}", hackathon_id))
.with_condition(&format!("hackathon_id = type::thing('app_hackathons', '{}')", hackathon_id))
.search_field("title")
.select_fields(vec!["*"]);
@@ -517,7 +517,7 @@ impl<'a> HackathonRepository<'a> {
let builder = QueryListBuilder::new(&self.state.surrealdb_ws, &table, &meta)
.with_condition("is_deleted = false")
.with_condition(&format!("hackathon_id = app_hackathons:{}", hackathon_id))
.with_condition(&format!("hackathon_id = type::thing('app_hackathons', '{}')", hackathon_id))
.search_field("project_name")
.select_fields(vec!["*"]);