aboutsummaryrefslogtreecommitdiff
path: root/src/handlers/api.rs
diff options
context:
space:
mode:
authorXe Iaso <me@christine.website>2023-01-05 16:14:29 -0500
committerXe Iaso <me@christine.website>2023-01-05 16:14:29 -0500
commit9e8c900e151c5e0637630b8fecb334314e52a2cc (patch)
tree5333ed338c7480dcf0501a304a4a3657076c3c09 /src/handlers/api.rs
parent51bd2d03837cab9ee97d81a5f6cf5ebde6adb4c2 (diff)
downloadxesite-authors.tar.xz
xesite-authors.zip
first attempt at multiple author supportauthors
Signed-off-by: Xe Iaso <me@christine.website>
Diffstat (limited to 'src/handlers/api.rs')
-rw-r--r--src/handlers/api.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/handlers/api.rs b/src/handlers/api.rs
index 828f93c..af94f68 100644
--- a/src/handlers/api.rs
+++ b/src/handlers/api.rs
@@ -1,12 +1,12 @@
use crate::{
- app::{config::Job, PronounSet, State},
+ app::{config::Author, PronounSet, State},
handlers::Result,
post::Post,
};
use axum::extract::{Extension, Json, Path};
use lazy_static::lazy_static;
use prometheus::{opts, register_int_counter_vec, IntCounterVec};
-use std::sync::Arc;
+use std::{collections::HashMap, sync::Arc};
lazy_static! {
static ref BLOG: IntCounterVec = register_int_counter_vec!(
@@ -23,14 +23,14 @@ lazy_static! {
#[axum_macros::debug_handler]
#[instrument(skip(state))]
-pub async fn salary_transparency(Extension(state): Extension<Arc<State>>) -> Json<Vec<Job>> {
+pub async fn authors(Extension(state): Extension<Arc<State>>) -> Json<HashMap<String, Author>> {
super::HIT_COUNTER
- .with_label_values(&["salary_transparency_json"])
+ .with_label_values(&["authors_json"])
.inc();
let state = state.clone();
let cfg = state.cfg.clone();
- Json(cfg.job_history.clone())
+ Json(cfg.authors.clone())
}
#[axum_macros::debug_handler]