feat: advance sitekey edit now allows modifying publication status

This commit is contained in:
Aravinth Manivannan
2023-06-30 16:48:53 +05:30
parent 6834e555d8
commit 22edb04ce2
5 changed files with 48 additions and 23 deletions

View File

@@ -76,6 +76,7 @@ pub struct UpdateCaptcha {
pub duration: u32,
pub description: String,
pub key: String,
pub publish_benchmarks: bool,
}
#[my_codegen::post(
@@ -139,6 +140,16 @@ pub mod runner {
e
);
}
if payload.publish_benchmarks {
data.db
.analytics_create_psuedo_id_if_not_exists(&payload.key)
.await?;
} else {
data.db
.analytics_delete_all_records_for_campaign(&payload.key)
.await?;
}
Ok(())
}
}