diff --git a/src/graphql/query.rs b/src/graphql/query.rs index d8ebfb7..07120e9 100644 --- a/src/graphql/query.rs +++ b/src/graphql/query.rs @@ -29,7 +29,7 @@ impl QueryRoot { let pool = ctx.data::>().expect("Pool not found in context"); let attendance_list = sqlx::query_as::<_, Attendance>( - "SELECT id, date, timein, timeout FROM Attendance WHERE date = $1" + "SELECT id, date, timein, timeout, is_present FROM Attendance WHERE date = $1" ) .bind(date) .fetch_all(pool.as_ref()) diff --git a/src/main.rs b/src/main.rs index 2040367..093df7a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -70,7 +70,7 @@ async fn scheduled_task(pool: Arc) { let timeout = NaiveTime::from_hms_opt(0, 0, 0); // Default time, can be modified as needed let attendance = sqlx::query( - "INSERT INTO Attendance (id, date, timein, timeout, present) VALUES ($1, $2, $3, $4, $5) ON CONFLICT (id, date) DO NOTHING RETURNING *" + "INSERT INTO Attendance (id, date, timein, timeout, is_present) VALUES ($1, $2, $3, $4, $5) ON CONFLICT (id, date) DO NOTHING RETURNING *" ) .bind(member.id) .bind(today)