Add feed model, link items to feeds

This commit is contained in:
2023-05-07 21:25:22 -04:00
parent f30be5f451
commit b2a5bf5882
10 changed files with 188 additions and 16 deletions

9
src/handlers/feeds.rs Normal file
View File

@@ -0,0 +1,9 @@
use axum::{extract::State, Json};
use sqlx::PgPool;
use crate::error::Error;
use crate::models::feed::{get_feeds, Feed};
pub async fn get(State(pool): State<PgPool>) -> Result<Json<Vec<Feed>>, Error> {
Ok(Json(get_feeds(pool).await?))
}