Skip to content

Commit

Permalink
Refactor routes to use query instead of list
Browse files Browse the repository at this point in the history
  • Loading branch information
DaviRain-Su committed Sep 15, 2023
1 parent a883f4c commit d0ff86e
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 7 deletions.
2 changes: 0 additions & 2 deletions backend/axum-db/src/routes/list/mod.rs

This file was deleted.

4 changes: 2 additions & 2 deletions backend/axum-db/src/routes/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
mod health_check;
mod list;
mod query;

use axum::http::{request::Parts, StatusCode};
use axum::{
Expand All @@ -8,7 +8,7 @@ use axum::{
response::IntoResponse,
};
pub use health_check::*;
pub use list::*;
pub use query::*;
use sqlx::postgres::PgPool;

pub async fn index() -> impl IntoResponse {
Expand Down
2 changes: 2 additions & 0 deletions backend/axum-db/src/routes/query/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pub mod query_all;
pub mod query_all_author;
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use crate::routes::list_all::ListAllItemsResponse;
// use crate::routes::query::ListAllItemsResponse;
use crate::routes::query::query_all::ListAllItemsResponse;
use crate::routes::DatabaseConnection;
use axum::response::IntoResponse;
use axum::Json;
Expand Down
4 changes: 2 additions & 2 deletions backend/axum-db/src/startup.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::configuration::{DatabaseSettings, Settings};
use crate::routes::list_all::list_all_items;
use crate::routes::list_author::list_authors;
use crate::routes::query_all::list_all_items;
use crate::routes::query_all_author::list_authors;
use anyhow::Result;
use axum::routing::IntoMakeService;
use axum::Server;
Expand Down

0 comments on commit d0ff86e

Please sign in to comment.