switch to using schema dsl for shift_reports

why? when I know damned well that this function is getting dumpstered when I start working on this portion of the code? /shrug
main
Zynh0722 2023-11-06 20:41:53 -08:00
parent a9eef2b68f
commit da718cf238
1 changed files with 6 additions and 6 deletions

View File

@ -143,13 +143,13 @@ async fn shift_report(State(state): State<AppState>, Path(id): Path<u32>) -> imp
}
async fn shift_reports(State(state): State<AppState>) -> impl IntoResponse {
let mut shifts: Vec<Shift> = {
use cm_lib::schema::shifts::dsl::*;
let mut conn = state.connection.get().await.unwrap();
let mut shifts: Vec<Shift> = shifts::table
.select(Shift::as_select())
.load(&mut conn)
.await
.unwrap();
shifts.load(&mut conn).await.unwrap()
};
shifts.sort_by(|a, b| b.start.cmp(&a.start));