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? /shrugmain
parent
a9eef2b68f
commit
da718cf238
10
src/main.rs
10
src/main.rs
|
@ -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));
|
||||
|
||||
|
|
Loading…
Reference in New Issue