fmt
This commit is contained in:
parent
2f149503bb
commit
6ea544a0f6
10 changed files with 144 additions and 60 deletions
|
|
@ -14,7 +14,6 @@ pub const MAX_CELLS_PER_REQUEST: usize = 200000;
|
|||
pub const MAX_POIS_PER_REQUEST: usize = 3000;
|
||||
|
||||
pub const PROPERTIES_LIMIT: usize = 100;
|
||||
pub const ACTUAL_LISTINGS_LIMIT: usize = 500;
|
||||
pub const PLACES_LIMIT: usize = 20;
|
||||
pub const PRICE_HISTORY_POINTS_LIMIT: usize = 5000;
|
||||
pub const POSTCODE_SEARCH_OFFSET: f64 = 0.02;
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ use serde::{Deserialize, Serialize};
|
|||
use tracing::info;
|
||||
|
||||
use crate::api_error::ApiError;
|
||||
use crate::consts::ACTUAL_LISTINGS_LIMIT;
|
||||
use crate::data::ActualListing;
|
||||
use crate::features::property_level_feature_names;
|
||||
use crate::parsing::{
|
||||
|
|
@ -41,7 +40,6 @@ pub async fn get_actual_listings(
|
|||
Query(params): Query<ActualListingsParams>,
|
||||
) -> Result<Json<ActualListingsResponse>, ApiError> {
|
||||
let state = shared.load_state();
|
||||
let limit = ACTUAL_LISTINGS_LIMIT;
|
||||
let offset = params.offset.unwrap_or(0);
|
||||
let Some(actual_listings) = state.actual_listings.clone() else {
|
||||
return Ok(Json(ActualListingsResponse {
|
||||
|
|
@ -132,11 +130,9 @@ pub async fn get_actual_listings(
|
|||
})
|
||||
});
|
||||
|
||||
let truncated = total_matching > offset.saturating_add(limit);
|
||||
let listings: Vec<ActualListing> = matching_rows
|
||||
.iter()
|
||||
.skip(offset)
|
||||
.take(limit)
|
||||
.map(|&row| actual_listings.listing_at(row))
|
||||
.collect();
|
||||
|
||||
|
|
@ -155,7 +151,7 @@ pub async fn get_actual_listings(
|
|||
listings,
|
||||
total: total_matching,
|
||||
offset,
|
||||
truncated,
|
||||
truncated: false,
|
||||
})
|
||||
})
|
||||
.await
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue