mirror of
https://github.com/perstarkse/minne.git
synced 2026-12-01 17:53:56 +01:00
feat: categories list api router
This commit is contained in:
1 parent
0169c9b525
commit
8d1be03078
4 files changed
+18
-2
No files matched your search
@@ -0,0 +1,13 @@
|
||||
use axum::{extract::State, response::IntoResponse, Extension, Json};
|
||||
use common::storage::types::user::User;
|
||||
|
||||
use crate::{api_state::ApiState, error::ApiError};
|
||||
|
||||
pub async fn get_categories(
|
||||
State(state): State<ApiState>,
|
||||
Extension(user): Extension<User>,
|
||||
) -> Result<impl IntoResponse, ApiError> {
|
||||
let categories = User::get_user_categories(&user.id, &state.db).await?;
|
||||
|
||||
Ok(Json(categories))
|
||||
}
|
||||
@@ -1 +1,2 @@
|
||||
pub mod categories;
|
||||
pub mod ingress;
|
||||
Reference in new issue
Block a user