added project modal, portal, and backend code to get description
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
use sqlx::{FromRow, Pool, Postgres, Row};
|
||||
use sqlx::{Pool, Postgres};
|
||||
|
||||
use crate::routes::projects::Project;
|
||||
|
||||
@@ -7,7 +7,7 @@ impl ProjectsDatasource {
|
||||
pub async fn get_all(pool: &Pool<Postgres>) -> Result<Vec<Project>, sqlx::Error> {
|
||||
sqlx::query_as!(
|
||||
Project,
|
||||
"SELECT project_id, title, repo, summary, tech, wip, created_at FROM projects p WHERE deleted_at IS NULL ORDER BY p.created_at DESC"
|
||||
"SELECT project_id, title, repo, summary, description, tech, wip, created_at FROM projects p WHERE deleted_at IS NULL ORDER BY p.created_at DESC"
|
||||
)
|
||||
.fetch_all(pool)
|
||||
.await
|
||||
|
||||
@@ -9,6 +9,7 @@ pub struct Project {
|
||||
pub title: String,
|
||||
pub repo: Option<String>,
|
||||
pub summary: String,
|
||||
pub description: Option<String>,
|
||||
pub tech: String,
|
||||
pub wip: Option<bool>,
|
||||
#[serde(serialize_with = "serialize_datetime")]
|
||||
@@ -66,5 +67,3 @@ impl ProjectsRoute {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user