Commit

33f9b71

Rust
use suprnova::{handler, inertia_response, InertiaProps, Request, Response};

#[derive(InertiaProps)]
pub struct DashboardProps {
    pub title: String,
    pub user: UserDto,
}

#[derive(InertiaProps)]
pub struct UserDto {
    pub name: String,
    pub email: String,
}

#[handler]
pub async fn dashboard(req: Request) -> Response {
    inertia_response!(
        &req,
        "Dashboard",
        DashboardProps {
            title: "Welcome!".into(),
            user: UserDto {
                name: "Ada".into(),
                email: "ada@example.com".into(),
            },
        }
    )
}

commit 33f9b71