use laravel::http::MiddlewareGroup;
use laravel::routing::Router;
use crate::http::handlers;
pub(crate) fn register_routes(route: &mut Router, prefix: &str, middleware: MiddlewareGroup) {
route.prefix(prefix).middleware(middleware).group(|route| {
route.get("/api/panel", handlers::panel_schema);
route.get("/api/dashboard", handlers::dashboard);
route.get("/api/search", handlers::global_search);
route.get("/api/resources/{slug}", handlers::list_records);
route.post("/api/resources/{slug}", handlers::create_record);
route.get("/api/resources/{slug}/export", handlers::export_records);
route.post("/api/resources/{slug}/bulk/{action}", handlers::run_bulk_action);
route.get("/api/resources/{slug}/records/{id}", handlers::show_record);
route.patch("/api/resources/{slug}/records/{id}", handlers::update_record);
route.put("/api/resources/{slug}/records/{id}", handlers::update_record);
route.delete("/api/resources/{slug}/records/{id}", handlers::delete_record);
route.post(
"/api/resources/{slug}/records/{id}/actions/{action}",
handlers::run_row_action,
);
route.get("/", handlers::shell_root);
route.get("/{*path}", handlers::shell_fallback);
});
}