aboutsummaryrefslogtreecommitdiff
path: root/src/handlers/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/handlers/mod.rs')
-rw-r--r--src/handlers/mod.rs28
1 files changed, 27 insertions, 1 deletions
diff --git a/src/handlers/mod.rs b/src/handlers/mod.rs
index fa8203c..fc2a154 100644
--- a/src/handlers/mod.rs
+++ b/src/handlers/mod.rs
@@ -1,9 +1,13 @@
-use crate::{app::State, templates};
+use crate::{
+ app::{Job, State},
+ templates,
+};
use axum::{
body,
extract::Extension,
http::StatusCode,
response::{Html, IntoResponse, Response},
+ Json,
};
use chrono::{Datelike, Timelike, Utc, Weekday};
use lazy_static::lazy_static;
@@ -74,6 +78,28 @@ pub async fn feeds() -> Result {
#[axum_macros::debug_handler]
#[instrument(skip(state))]
+pub async fn salary_transparency(Extension(state): Extension<Arc<State>>) -> Result {
+ HIT_COUNTER
+ .with_label_values(&["salary_transparency"])
+ .inc();
+ let state = state.clone();
+ let mut result: Vec<u8> = vec![];
+ templates::salary_transparency(&mut result, state.cfg.clone())?;
+ Ok(Html(result))
+}
+
+#[axum_macros::debug_handler]
+#[instrument(skip(state))]
+pub async fn salary_transparency_json(Extension(state): Extension<Arc<State>>) -> Json<Vec<Job>> {
+ HIT_COUNTER
+ .with_label_values(&["salary_transparency_json"])
+ .inc();
+
+ Json(state.clone().cfg.clone().job_history.clone())
+}
+
+#[axum_macros::debug_handler]
+#[instrument(skip(state))]
pub async fn resume(Extension(state): Extension<Arc<State>>) -> Result {
HIT_COUNTER.with_label_values(&["resume"]).inc();
let state = state.clone();