mirror of
https://github.com/Lumither/nocturne.git
synced 2026-10-17 10:26:21 +00:00
feat(blog::api) impl GET /blog/posts
This commit is contained in:
5 files changed
+159
-16
No files matched your search
@@ -1,7 +1,4 @@
|
||||
use crate::{
|
||||
constants::blog::PAGE_SIZE,
|
||||
utils::axum_response::{err_resp, succ_resp},
|
||||
};
|
||||
use crate::{constants::blog::PAGE_SIZE, err_resp_log, utils::axum_response::succ_resp};
|
||||
|
||||
use axum::{extract::State, http::StatusCode, response::Response};
|
||||
use serde_json::{Value, json};
|
||||
@@ -50,6 +47,6 @@ pub async fn handler(State(db_connection): State<PgPool>) -> Response<String> {
|
||||
.await
|
||||
{
|
||||
Ok(res) => succ_resp(StatusCode::OK, PaginationResponse::from(res).into()),
|
||||
Err(e) => err_resp(StatusCode::INTERNAL_SERVER_ERROR, &e.to_string()),
|
||||
Err(e) => err_resp_log!(StatusCode::INTERNAL_SERVER_ERROR, &e.to_string()),
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user