added duration field to add_level

This commit is contained in:
realaravinth
2021-05-04 10:49:44 +05:30
parent e9c84b4ed4
commit e83a362e75
3 changed files with 13 additions and 5 deletions

View File

@@ -53,6 +53,7 @@ pub mod routes {
#[derive(Serialize, Deserialize)]
pub struct AddLevels {
pub levels: Vec<Level>,
pub duration: u32,
}
pub fn services(cfg: &mut web::ServiceConfig) {
@@ -103,7 +104,7 @@ async fn add_levels(
defense.build()?;
let mcaptcha_config = add_mcaptcha_util(&data, &id).await?;
let mcaptcha_config = add_mcaptcha_util(payload.duration, &data, &id).await?;
for level in payload.levels.iter() {
let difficulty_factor = level.difficulty_factor as i32;