Skip to content

Commit

Permalink
fix: resolve return 404 when route not found
Browse files Browse the repository at this point in the history
  • Loading branch information
Lzyct committed Sep 25, 2024
1 parent b9449a4 commit ddbd62b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils/handler.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use actix_web::HttpResponse;
use actix_web::{http::StatusCode, HttpResponse};

use crate::core::response::{Diagnostic, ResponseBody};

pub async fn route_not_found() -> HttpResponse {
ResponseBody::<()>::new(Diagnostic::new("404", "Route not found"), None).into()
HttpResponse::build(StatusCode::NOT_FOUND).json(ResponseBody::<()>::new(Diagnostic::new("404", "Route not found"), None))
}

0 comments on commit ddbd62b

Please sign in to comment.