Still working on this shit...
This commit is contained in:
1 parent
89597dcac2
commit
801abed9a4
6 files changed
+65
-15
No files matched your search
+6
-2
@@ -5,8 +5,8 @@ use clap::builder::TypedValueParser;
|
||||
use log::info;
|
||||
use minijinja::context;
|
||||
use serde::Deserialize;
|
||||
use crate::db::users::list_users;
|
||||
|
||||
use crate::db::users::list_users;
|
||||
use crate::events::Event;
|
||||
use crate::services::ServiceFactory;
|
||||
use crate::util::SQLiteConnectionFactory;
|
||||
@@ -81,9 +81,13 @@ pub async fn push_event(
|
||||
if path_event_type.to_string() != form.event_type {
|
||||
return Err(error::ErrorBadRequest("Inconsistent event type."))
|
||||
}
|
||||
let validation = form.event.validate_event();
|
||||
if validation.is_err() {
|
||||
return Err(error::ErrorBadRequest(validation.err().unwrap()));
|
||||
}
|
||||
let _ = event_channel.send(form.event).await;
|
||||
let ctx = context! {
|
||||
event_type => "bob le chef",
|
||||
event_type => "event received.",
|
||||
};
|
||||
tmpl_env.render("partials/v1/event_processed.html", ctx)
|
||||
}
|
||||
Reference in new issue
Block a user