Refactor: Remove unused structs, redundant services, and streamline repository models
This commit is contained in:
@@ -18,7 +18,6 @@ fn get_session(session: &State<SessionState>) -> Result<(String, Lang), AppError
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct GetSpellListData {
|
||||
pub book_id: String,
|
||||
pub enabled: bool,
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
|
||||
@@ -5,7 +5,7 @@ use crate::shared::types::Lang;
|
||||
|
||||
pub struct SpellResult {
|
||||
pub spell_id: String,
|
||||
pub book_id: String,
|
||||
pub _book_id: String,
|
||||
pub name: String,
|
||||
pub description: Option<String>,
|
||||
pub appearance: Option<String>,
|
||||
@@ -54,7 +54,7 @@ pub fn fetch_spells(conn: &Connection, user_id: &str, book_id: &str, lang: Lang)
|
||||
let spells = statement
|
||||
.query_map(params![user_id, book_id], |query_row| {
|
||||
Ok(SpellResult {
|
||||
spell_id: query_row.get(0)?, book_id: query_row.get(1)?,
|
||||
spell_id: query_row.get(0)?, _book_id: query_row.get(1)?,
|
||||
name: query_row.get(2)?, description: query_row.get(3)?,
|
||||
appearance: query_row.get(4)?, tags: query_row.get(5)?,
|
||||
power_level: query_row.get(6)?, components: query_row.get(7)?,
|
||||
@@ -83,7 +83,7 @@ pub fn fetch_spell_by_id(conn: &Connection, user_id: &str, spell_id: &str, lang:
|
||||
let spells = statement
|
||||
.query_map(params![user_id, spell_id], |query_row| {
|
||||
Ok(SpellResult {
|
||||
spell_id: query_row.get(0)?, book_id: query_row.get(1)?,
|
||||
spell_id: query_row.get(0)?, _book_id: query_row.get(1)?,
|
||||
name: query_row.get(2)?, description: query_row.get(3)?,
|
||||
appearance: query_row.get(4)?, tags: query_row.get(5)?,
|
||||
power_level: query_row.get(6)?, components: query_row.get(7)?,
|
||||
|
||||
@@ -52,18 +52,6 @@ pub struct SpellListResponse {
|
||||
pub tags: Vec<SpellTagProps>,
|
||||
}
|
||||
|
||||
pub struct SyncedSpell {
|
||||
pub id: String,
|
||||
pub name: String,
|
||||
pub last_update: i64,
|
||||
}
|
||||
|
||||
pub struct SyncedSpellTag {
|
||||
pub id: String,
|
||||
pub name: String,
|
||||
pub last_update: i64,
|
||||
}
|
||||
|
||||
/// Retrieves all spell tags for a specific book.
|
||||
/// * `conn` - Database connection
|
||||
/// * `user_id` - The unique identifier of the user
|
||||
|
||||
Reference in New Issue
Block a user