2025-03-13 23:40:16 +07:00
|
|
|
use super::{
|
|
|
|
|
mutation_login, mutation_register, AuthLoginRequestDto, AuthRegisterRequestDto,
|
|
|
|
|
};
|
2025-02-25 02:00:19 +07:00
|
|
|
use crate::AppState;
|
2025-03-13 23:40:16 +07:00
|
|
|
use axum::{response::IntoResponse, Extension, Json};
|
2025-02-25 02:00:19 +07:00
|
|
|
|
|
|
|
|
pub async fn post_login(
|
|
|
|
|
Extension(state): Extension<AppState>,
|
|
|
|
|
Json(payload): Json<AuthLoginRequestDto>,
|
|
|
|
|
) -> impl IntoResponse {
|
|
|
|
|
mutation_login(payload, &state).await
|
2025-02-08 00:58:54 +07:00
|
|
|
}
|
2025-03-13 23:40:16 +07:00
|
|
|
|
|
|
|
|
pub async fn post_register(
|
|
|
|
|
Extension(state): Extension<AppState>,
|
|
|
|
|
Json(payload): Json<AuthRegisterRequestDto>,
|
|
|
|
|
) -> impl IntoResponse {
|
|
|
|
|
mutation_register(payload, &state).await
|
|
|
|
|
}
|