refactor: Replace make_thing with make_thing_from_enum for consistency and clarity across multiple modules

This commit is contained in:
MythEclipse
2025-09-22 09:10:20 +07:00
parent acccae9f7c
commit 6da1b2a7e7
14 changed files with 101 additions and 148 deletions
-7
View File
@@ -162,7 +162,6 @@ impl AuthServiceTrait for AuthService {
payload: AuthLoginRequestDto,
state: &AppState,
) -> Pin<Box<dyn Future<Output = Response> + Send>> {
let payload = payload;
let state = state.to_owned();
Box::pin(async move {
if let Err((status, message)) = validate_request(&payload) {
@@ -264,7 +263,6 @@ impl AuthServiceTrait for AuthService {
payload: AuthRegisterRequestDto,
state: &AppState,
) -> Pin<Box<dyn Future<Output = Response> + Send>> {
let payload = payload;
let state = state.to_owned();
Box::pin(async move {
if let Err((status, message)) = validate_request(&payload) {
@@ -367,7 +365,6 @@ impl AuthServiceTrait for AuthService {
payload: AuthResendOtpRequestDto,
state: &AppState,
) -> Pin<Box<dyn Future<Output = Response> + Send>> {
let payload = payload;
let state = state.to_owned();
Box::pin(async move {
if let Err((status, message)) = validate_request(&payload) {
@@ -408,7 +405,6 @@ impl AuthServiceTrait for AuthService {
payload: AuthRefreshTokenRequestDto,
state: &AppState,
) -> Pin<Box<dyn Future<Output = Response> + Send>> {
let payload = payload;
let state = state.to_owned();
Box::pin(async move {
if let Err((status, message)) = validate_request(&payload) {
@@ -462,7 +458,6 @@ impl AuthServiceTrait for AuthService {
payload: AuthResendOtpRequestDto,
state: &AppState,
) -> Pin<Box<dyn Future<Output = Response> + Send>> {
let payload = payload;
let state = state.to_owned();
Box::pin(async move {
if let Err((status, message)) = validate_request(&payload) {
@@ -500,7 +495,6 @@ impl AuthServiceTrait for AuthService {
payload: AuthVerifyEmailRequestDto,
state: &AppState,
) -> Pin<Box<dyn Future<Output = Response> + Send>> {
let payload = payload;
let state = state.to_owned();
Box::pin(async move {
if let Err((status, message)) = validate_request(&payload) {
@@ -556,7 +550,6 @@ impl AuthServiceTrait for AuthService {
payload: AuthNewPasswordRequestDto,
state: &AppState,
) -> Pin<Box<dyn Future<Output = Response> + Send>> {
let payload = payload;
let state = state.to_owned();
Box::pin(async move {
if let Err((status, message)) = validate_request(&payload) {