#
mcaptcha/pages/panel/sitekey/
delete.rs

    1// Copyright (C) 2022  Aravinth Manivannan <realaravinth@batsense.net>
    2// SPDX-FileCopyrightText: 2023 Aravinth Manivannan <realaravinth@batsense.net>
    3//
    4// SPDX-License-Identifier: AGPL-3.0-or-later
    5
    6use actix_web::{web, HttpResponse, Responder};
    7use my_codegen::get;
    8use sailfish::TemplateOnce;
    9
    10use crate::pages::auth::sudo::SudoPage;
    11use crate::{PAGES, V1_API_ROUTES};
    12
    13#[get(
    14    path = "PAGES.panel.sitekey.delete",
    15    wrap = "crate::pages::get_middleware()"
    16)]
    17pub async fn delete_sitekey(path: web::Path<String>) -> impl Responder {
    18    let key = path.into_inner();
    19    let data = vec![("sitekey", key)];
    20    let page = SudoPage::new(V1_API_ROUTES.captcha.delete, Some(data))
    21        .render_once()
    22        .unwrap();
    23    HttpResponse::Ok()
    24        .content_type("text/html; charset=utf-8")
    25        .body(page)
    26}