refactor(imports): remove unused imports
This commit is contained in:
parent
a35d4d557d
commit
63aaa57fa1
4 changed files with 3 additions and 19 deletions
|
@ -1,7 +1,7 @@
|
|||
#[cfg(feature = "ssr")]
|
||||
use actix_web::{web, HttpResponse};
|
||||
#[cfg(feature = "ssr")]
|
||||
use crate::db::{Database, DbItem};
|
||||
use crate::db::Database;
|
||||
#[cfg(feature = "ssr")]
|
||||
use std::sync::Arc;
|
||||
#[cfg(feature = "ssr")]
|
||||
|
|
|
@ -8,7 +8,6 @@ use crate::models::item::Item;
|
|||
use std::collections::HashMap;
|
||||
use std::sync::Arc;
|
||||
use wasm_bindgen::JsCast;
|
||||
use web_sys::window;
|
||||
use std::rc::Rc;
|
||||
#[derive(Deserialize, Clone, Debug)]
|
||||
struct WikidataSuggestion {
|
||||
|
@ -17,16 +16,6 @@ struct WikidataSuggestion {
|
|||
description: Option<String>,
|
||||
}
|
||||
|
||||
|
||||
#[derive(Deserialize, Debug)]
|
||||
pub struct DbItem {
|
||||
id: String,
|
||||
name: String,
|
||||
description: String,
|
||||
wikidata_id: Option<String>,
|
||||
custom_properties: String,
|
||||
}
|
||||
|
||||
//function to load items from database
|
||||
pub async fn load_items_from_db(current_url: &str) -> Result<Vec<Item>, String> {
|
||||
let response = gloo_net::http::Request::get(&format!("/api/items?url={}", current_url))
|
||||
|
@ -539,8 +528,6 @@ pub fn ItemsList(
|
|||
if !value.is_empty() {
|
||||
if let Some(wikidata_id) = &item.wikidata_id {
|
||||
let wikidata_id = wikidata_id.clone();
|
||||
let set_fetched_properties = set_fetched_properties.clone();
|
||||
let set_property_labels = set_property_labels.clone();
|
||||
spawn_local(async move {
|
||||
let properties = fetch_item_properties(&wikidata_id).await;
|
||||
log!("Fetched properties for index {}: {:?}", index, properties);
|
||||
|
@ -689,8 +676,6 @@ pub fn ItemsList(
|
|||
|
||||
// Fetch additional properties from Wikidata
|
||||
let wikidata_id = id.clone();
|
||||
let set_fetched_properties = set_fetched_properties.clone();
|
||||
let set_property_labels = set_property_labels.clone();
|
||||
spawn_local(async move {
|
||||
let properties = fetch_item_properties(&wikidata_id).await;
|
||||
// log!("Fetched properties for Wikidata ID {}: {:?}", wikidata_id, properties);
|
||||
|
|
|
@ -5,7 +5,6 @@ mod db_impl {
|
|||
use std::sync::Arc;
|
||||
use tokio::sync::Mutex;
|
||||
use leptos::logging;
|
||||
use serde_json;
|
||||
use std::collections::HashMap;
|
||||
use crate::models::item::Item;
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
use actix_web::{web, HttpResponse, Responder};
|
||||
use std::sync::Arc;
|
||||
use tokio::sync::Mutex;
|
||||
use compareware::db::{Database, DbItem};
|
||||
use compareware::db::Database;
|
||||
use compareware::api::{ItemRequest,create_item, get_items, delete_item_by_url};
|
||||
use compareware::models::item::Item;
|
||||
|
||||
|
@ -14,7 +14,7 @@ async fn main() -> std::io::Result<()> {
|
|||
use leptos_actix::{generate_route_list, LeptosRoutes};
|
||||
use compareware::app::*;
|
||||
use compareware::db::Database;
|
||||
use compareware::api::{get_items, create_item, delete_item, delete_property, delete_item_by_url, delete_property_by_url, create_item_by_url, get_items_by_url}; // Import API handlers
|
||||
use compareware::api::{get_items, create_item, delete_item, delete_property}; // Import API handlers
|
||||
use std::sync::Arc;
|
||||
use tokio::sync::Mutex;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue