Skip to content

Commit

Permalink
fix; get_rfp_with_snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
Tguntenaar committed Nov 19, 2024
1 parent d001187 commit 3922276
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions src/db/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,10 @@ impl DB {
after_date: i64,
after_block: i64,
) -> Result<(), Error> {
println!("Storing timestamp: {}", after_date);
println!(
"Storing timestamp: {} and block: {}",
after_date, after_block
);
println!("Storing date: {}", timestamp_to_date_string(after_date));
sqlx::query!(
r#"
Expand Down Expand Up @@ -686,8 +689,8 @@ impl DB {

pub async fn get_rfp_with_all_snapshots(
&self,
id: i32,
) -> anyhow::Result<(Vec<RfpSnapshotRecord>, i32)> {
id: i64,
) -> anyhow::Result<(Vec<RfpSnapshotRecord>, i64)> {
// Group by ts
// Build the SQL query for fetching data with the validated order clause
let data_sql = r#"
Expand Down
2 changes: 1 addition & 1 deletion src/entrypoints/rfp/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ async fn get_rfp(rfp_id: i32, contract: &State<AccountId>) -> Result<Json<Versio
#[utoipa::path(get, path = "/{rfp_id}/snapshots")]
#[get("/<rfp_id>/snapshots")]
async fn get_rfp_with_snapshots(
rfp_id: i32,
rfp_id: i64,
db: &State<DB>,
) -> Result<Json<Vec<RfpSnapshotRecord>>, Status> {
match db.get_rfp_with_all_snapshots(rfp_id).await {
Expand Down

0 comments on commit 3922276

Please sign in to comment.