CRUD for project
This commit is contained in:
@@ -13,24 +13,6 @@ pub async fn index(v: impl ViewRenderer, ctx: &AppContext) -> Result<impl IntoRe
|
||||
)
|
||||
}
|
||||
|
||||
pub async fn projects(v: impl ViewRenderer, ctx: &AppContext) -> Result<impl IntoResponse> {
|
||||
let projects = services::projects::get_all_projects_dto(ctx).await?;
|
||||
|
||||
format::render().view(&v, "website/projects.html", data!({"projects": projects}))
|
||||
}
|
||||
|
||||
pub async fn project_detail(v: impl ViewRenderer, ctx: &AppContext, id: i32) -> Result<impl IntoResponse> {
|
||||
let project = services::projects::get_project_dto(ctx, id).await?;
|
||||
|
||||
format::render().view(&v, "website/project_detail.html", data!({"project": project}))
|
||||
}
|
||||
|
||||
pub async fn project_detail_from_name(v: impl ViewRenderer, ctx: &AppContext, name: String) -> Result<impl IntoResponse> {
|
||||
let project = services::projects::get_project_dto_by_name(ctx, &name).await?;
|
||||
|
||||
format::render().view(&v, "website/project_detail.html", data!({"project": project}))
|
||||
}
|
||||
|
||||
pub async fn about(v: impl ViewRenderer) -> Result<impl IntoResponse> {
|
||||
let age = services::website::get_current_age();
|
||||
|
||||
|
Reference in New Issue
Block a user