refactor: clean up album and auth handlers by removing unused structs and imports

This commit is contained in:
2025-11-04 06:02:10 +01:00
parent eaf4c90fa8
commit 4f7b93a8b0
6 changed files with 83 additions and 89 deletions

View File

@@ -1,15 +1,8 @@
use axum::{Json, extract::State, http::StatusCode};
use libertas_core::schema::{CreateUserData, LoginUserData, UserResponse};
use serde::{Deserialize, Serialize};
use libertas_core::schema::{CreateUserData, LoginUserData};
use crate::{error::ApiError, state::AppState};
use crate::{error::ApiError, schema::{LoginRequest, LoginResponse, RegisterRequest, UserResponse}, state::AppState};
#[derive(Deserialize)]
pub struct RegisterRequest {
pub username: String,
pub email: String,
pub password: String,
}
pub async fn register(
State(state): State<AppState>,
@@ -32,17 +25,6 @@ pub async fn register(
Ok((StatusCode::CREATED, Json(response)))
}
#[derive(Deserialize)]
pub struct LoginRequest {
pub username_or_email: String,
pub password: String,
}
#[derive(Serialize)]
pub struct LoginResponse {
token: String,
}
pub async fn login(
State(state): State<AppState>,
Json(payload): Json<LoginRequest>,