<% for action in actions %>
<% endfor %>
use axum::{Router, routing::get};
use ocre::{ApiResult, Ctx, Json};
use serde::Serialize;
<% if auth %>
use crate::auth_api::BearerUser;
<% endif %>
pub fn routes() -> Router<Ctx> {
Router::new()
<% for action in actions %>
.route("<%= action.path %>", get(<%= action.name %>))
<% endfor %>
}
<% for action in actions %>
#[derive(Serialize)]
struct <%= action.pascal %>Response {
message: &'static str,
}
<% if auth %>
async fn <%= action.name %>(BearerUser(_user): BearerUser) -> ApiResult<Json<<%= action.pascal %>Response>> {
<% else %>
async fn <%= action.name %>() -> ApiResult<Json<<%= action.pascal %>Response>> {
<% endif %>
Ok(Json(<%= action.pascal %>Response { message: "Edit <%= action.name %> in src/<%= file %>.rs" }))
}
<% endfor %>