Move /commit/:hash/enqueue to /admin/queue/add

This commit is contained in:
Joscha 2023-08-13 15:33:11 +02:00
parent 08e240d7db
commit 087ecfd783
9 changed files with 113 additions and 40 deletions

View file

@ -1,3 +1,4 @@
mod admin;
mod api;
mod commit;
mod index;
@ -6,13 +7,13 @@ mod queue;
mod r#static;
mod worker;
use axum::{
routing::{get, post},
Router,
};
use axum::{routing::get, Router};
use axum_extra::routing::RouterExt;
use crate::{config::Config, somehow};
use self::admin::queue::post_admin_queue_add;
use super::Server;
pub enum Tab {
@ -49,10 +50,10 @@ pub async fn run(server: Server) -> somehow::Result<()> {
let app = Router::new()
.route("/", get(index::get))
.route("/commit/:hash", get(commit::get))
.route("/commit/:hash/enqueue", post(commit::post_enqueue))
.route("/queue/", get(queue::get))
.route("/queue/inner", get(queue::get_inner))
.route("/worker/:name", get(worker::get))
.typed_post(post_admin_queue_add)
.merge(api::router(&server))
.fallback(get(r#static::static_handler))
.with_state(server.clone());