add site key form

This commit is contained in:
realaravinth
2021-05-03 20:24:03 +05:30
parent 0531a26274
commit 812b0ff2c9
49 changed files with 1253 additions and 597 deletions

View File

@@ -88,7 +88,7 @@ pub struct MCaptchaDetails {
}
// this should be called from within add levels
async fn add_mcaptcha(data: web::Data<Data>, id: Identity) -> ServiceResult<impl Responder> {
pub async fn add_mcaptcha_util(data: &Data, id: &Identity) -> ServiceResult<MCaptchaDetails> {
let username = id.identity().unwrap();
let mut key;
@@ -125,7 +125,12 @@ async fn add_mcaptcha(data: web::Data<Data>, id: Identity) -> ServiceResult<impl
}
}
}
Ok(resp)
}
// this should be called from within add levels
async fn add_mcaptcha(data: web::Data<Data>, id: Identity) -> ServiceResult<impl Responder> {
let resp = add_mcaptcha_util(&data, &id).await?;
Ok(HttpResponse::Ok().json(resp))
}