seems alright
This commit is contained in:
parent
ebe7bbb51d
commit
eac1bd0d13
58 changed files with 23125 additions and 153505 deletions
|
|
@ -62,8 +62,11 @@ pub struct Property {
|
|||
pub features: FxHashMap<String, f32>,
|
||||
}
|
||||
|
||||
/// Shared paginated list of `Property` records. Used by both
|
||||
/// `/api/hexagon-properties` (lookup by H3 cell) and `/api/postcode-properties`
|
||||
/// (lookup by postcode) so the frontend can render either result the same way.
|
||||
#[derive(Serialize)]
|
||||
pub struct HexagonPropertiesResponse {
|
||||
pub struct PropertyListResponse {
|
||||
pub properties: Vec<Property>,
|
||||
pub total: usize,
|
||||
pub limit: usize,
|
||||
|
|
@ -183,7 +186,7 @@ pub async fn get_hexagon_properties(
|
|||
State(shared): State<Arc<SharedState>>,
|
||||
Extension(user): Extension<OptionalUser>,
|
||||
Query(params): Query<HexagonPropertiesParams>,
|
||||
) -> Result<Json<HexagonPropertiesResponse>, axum::response::Response> {
|
||||
) -> Result<Json<PropertyListResponse>, axum::response::Response> {
|
||||
let state = shared.load_state();
|
||||
let cell = h3o::CellIndex::from_str(¶ms.h3).map_err(|error| {
|
||||
warn!(h3 = %params.h3, error = %error, "Invalid H3 cell index");
|
||||
|
|
@ -306,7 +309,7 @@ pub async fn get_hexagon_properties(
|
|||
"GET /api/hexagon-properties"
|
||||
);
|
||||
|
||||
Ok(HexagonPropertiesResponse {
|
||||
Ok(PropertyListResponse {
|
||||
properties,
|
||||
total,
|
||||
limit,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue