feat: Add public routes for hackathons and enhance permissions checks to support both names and IDs
This commit is contained in:
@@ -504,11 +504,9 @@ pub async fn delete_hackathon_submission(
|
||||
|
||||
pub fn hackathon_routes() -> Router {
|
||||
Router::new()
|
||||
// Hackathon routes
|
||||
.route("/", post(create_hackathon))
|
||||
.route("/", get(list_hackathons))
|
||||
.route("/{id}", get(get_hackathon))
|
||||
.route("/{id}", put(update_hackathon))
|
||||
// Hackathon routes
|
||||
.route("/", post(create_hackathon))
|
||||
.route("/{id}", put(update_hackathon))
|
||||
.route("/{id}", delete(delete_hackathon))
|
||||
|
||||
// Hackathon Events routes
|
||||
|
||||
@@ -8,4 +8,14 @@ pub use hackathon::hackathon_router;
|
||||
// Main route constructor
|
||||
pub fn hackathon_protected_routes() -> Router {
|
||||
Router::new().nest("/hackathons", hackathon_router())
|
||||
}
|
||||
|
||||
// Public routes for hackathons (only listing and retrieving)
|
||||
pub fn hackathon_public_routes() -> Router {
|
||||
use hackathon::hackathon_controller::{list_hackathons, get_hackathon};
|
||||
Router::new()
|
||||
.nest("/hackathons", Router::new()
|
||||
.route("/", axum::routing::get(list_hackathons))
|
||||
.route("/{id}", axum::routing::get(get_hackathon))
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user