Catalog Template API Routes (routes/catalog.rs)

clawdstrike · crates/services/control-api/src/routes/catalog.rs · rust · Apache-2.0
integration, database, auth, lang:rust, fw:axum, tag:catalog

Axum routes for listing, creating, updating, deleting, and forking catalog templates plus categories. Reuse for authenticated CRUD APIs with tenant write/admin access checks.

// Source: https://github.com/backbay-labs/clawdstrike | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
use axum::extract::{Path, Query, State};
use axum::routing::{delete, get, post, put};
use axum::{Json, Router};
use serde_json::json;
use uuid::Uuid;

use crate::auth::AuthenticatedTenant;
use crate::error::ApiError;
use crate::models::catalog::{
    CatalogCategory, CatalogTemplate, CatalogTemplateListQuery, CreateCatalogTemplateRequest,
    UpdateCatalogTemplateRequest,
};
use crate::state::AppState;

pub fn router() -> Router<AppState> {
    Router::new()
        .route("/catalog/templates", get(list_templates))
        .route("/catalog/templates", post(create_template))
     

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key