feat: optimize imports to remove warnings
This commit is contained in:
1 parent
9c7b7f1d4f
commit
a2f69a83c2
16 files changed
+46
-109
No files matched your search
@@ -8,12 +8,12 @@ use crate::common::{
|
||||
ComparisonData, ComparisonType, MapListComparison, NumberComparison, NumberListComparison,
|
||||
TextComparison, TextListComparison, ValueType,
|
||||
};
|
||||
use leptos::leptos_dom::log;
|
||||
use leptos::prelude::ServerFnError;
|
||||
use leptos::server;
|
||||
|
||||
/// Helper function to create all sports comparisons. Only used to create initial
|
||||
/// comparison data, and should be removed upon completion of a comparison editor page.
|
||||
#[allow(unused)]
|
||||
fn create_sports_comparisons() -> Vec<ComparisonData> {
|
||||
vec![
|
||||
ComparisonData::new(
|
||||
@@ -184,12 +184,8 @@ fn create_sports_comparisons() -> Vec<ComparisonData> {
|
||||
]
|
||||
}
|
||||
|
||||
#[server(CreateTestComparisons, endpoint = "/comparisons/create-test")]
|
||||
pub async fn create_test_comparisons() -> Result<(), ServerFnError> {
|
||||
let client = create_dynamo_client().await;
|
||||
|
||||
log!("Creating test comparisons");
|
||||
|
||||
#[allow(unused)]
|
||||
fn make_comp_list() -> Vec<ComparisonData> {
|
||||
let test_comp = ComparisonData::new(
|
||||
"math_sat_comp",
|
||||
"math_sat",
|
||||
@@ -304,6 +300,19 @@ pub async fn create_test_comparisons() -> Result<(), ServerFnError> {
|
||||
comp_list.append(&mut sports_comps);
|
||||
comp_list.append(&mut major_comps);
|
||||
|
||||
comp_list
|
||||
}
|
||||
|
||||
#[server(CreateTestComparisons, endpoint = "/comparisons/create-test")]
|
||||
pub async fn create_test_comparisons() -> Result<(), ServerFnError> {
|
||||
use leptos::logging::log;
|
||||
|
||||
let client = create_dynamo_client().await;
|
||||
|
||||
log!("Creating test comparisons");
|
||||
|
||||
let comp_list = make_comp_list();
|
||||
|
||||
for comparison in comp_list {
|
||||
if let Err(err) = client
|
||||
.put_item()
|
||||
@@ -322,6 +331,8 @@ pub async fn create_test_comparisons() -> Result<(), ServerFnError> {
|
||||
|
||||
#[server]
|
||||
pub async fn get_comparison_info() -> Result<Vec<ComparisonData>, ServerFnError> {
|
||||
use leptos::logging::log;
|
||||
|
||||
let client = create_dynamo_client().await;
|
||||
|
||||
log!("Getting all comparisons from the database");
|
||||
|
||||
@@ -3,15 +3,19 @@ use aws_sdk_dynamodb::{
|
||||
types::AttributeValue,
|
||||
error::ProvideErrorMetadata,
|
||||
};
|
||||
|
||||
#[cfg(feature = "ssr")]
|
||||
use leptos::leptos_dom::log;
|
||||
use leptos::prelude::ServerFnError;
|
||||
use leptos::server;
|
||||
#[cfg(feature = "ssr")]
|
||||
use uuid::Uuid;
|
||||
use crate::common::{ExpandableInfo, ValueType};
|
||||
|
||||
#[cfg(feature = "ssr")]
|
||||
use crate::pages::utils::server_utils::create_dynamo_client;
|
||||
#[cfg(feature = "ssr")]
|
||||
use crate::common::ValueType;
|
||||
|
||||
use crate::common::ExpandableInfo;
|
||||
|
||||
use leptos::prelude::ServerFnError;
|
||||
use leptos::server;
|
||||
|
||||
#[server(GetScholarshipInfo, endpoint = "/scholarship/info/get")]
|
||||
pub async fn get_scholarship_info(id: String) -> Result<ExpandableInfo, ServerFnError> {
|
||||
|
||||
Reference in new issue
Block a user