captcha stats

This commit is contained in:
realaravinth
2021-05-27 14:47:29 +05:30
parent df89938f2a
commit fcdbe66b26
28 changed files with 412 additions and 122 deletions

View File

@@ -37,7 +37,10 @@ pub struct NotificationResp {
}
/// route handler that marks a notification read
#[my_codegen::post(path="crate::V1_API_ROUTES.notifications.mark_read", wrap="crate::CheckLogin")]
#[my_codegen::post(
path = "crate::V1_API_ROUTES.notifications.mark_read",
wrap = "crate::CheckLogin"
)]
pub async fn mark_read(
data: web::Data<Data>,
payload: web::Json<MarkReadReq>,
@@ -68,7 +71,6 @@ mod tests {
use crate::tests::*;
use crate::*;
#[actix_rt::test]
async fn notification_mark_read_works() {
const NAME1: &str = "notifuser122";
@@ -125,7 +127,6 @@ mod tests {
assert_eq!(notification.message, MESSAGE);
assert_eq!(notification.heading, HEADING);
let mark_read_payload = MarkReadReq {
id: notification.id.clone(),
};
@@ -138,7 +139,6 @@ mod tests {
.await;
assert_eq!(mark_read_resp.status(), StatusCode::OK);
let get_notifications_resp = test::call_service(
&mut app,
test::TestRequest::get()
@@ -151,6 +151,5 @@ mod tests {
let mut notifications: Vec<NotificationResp> =
test::read_body_json(get_notifications_resp).await;
assert!(notifications.pop().is_none());
}
}