Skip to content

Commit 9eaca53

Browse files
committed
Fix: Incorrect table name in query
1 parent a72f9ef commit 9eaca53

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/graphql/query.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ impl QueryRoot {
2929
let pool = ctx.data::<Arc<PgPool>>().expect("Pool not found in context");
3030

3131
let attendance_list = sqlx::query_as::<_, Attendance>(
32-
"SELECT id, date, timein, timeout FROM Attendance WHERE date = $1"
32+
"SELECT id, date, timein, timeout, is_present FROM Attendance WHERE date = $1"
3333
)
3434
.bind(date)
3535
.fetch_all(pool.as_ref())

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ async fn scheduled_task(pool: Arc<PgPool>) {
7070
let timeout = NaiveTime::from_hms_opt(0, 0, 0); // Default time, can be modified as needed
7171

7272
let attendance = sqlx::query(
73-
"INSERT INTO Attendance (id, date, timein, timeout, present) VALUES ($1, $2, $3, $4, $5) ON CONFLICT (id, date) DO NOTHING RETURNING *"
73+
"INSERT INTO Attendance (id, date, timein, timeout, is_present) VALUES ($1, $2, $3, $4, $5) ON CONFLICT (id, date) DO NOTHING RETURNING *"
7474
)
7575
.bind(member.id)
7676
.bind(today)

0 commit comments

Comments
 (0)