From e162dc988c90bf8ed5b32f5560a604c43824e112 Mon Sep 17 00:00:00 2001 From: jacekpoz Date: Mon, 16 Sep 2024 13:54:41 +0200 Subject: [PATCH] rename domain to site in the backend --- server/src/main.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/server/src/main.rs b/server/src/main.rs index 50505d5..80af5ef 100644 --- a/server/src/main.rs +++ b/server/src/main.rs @@ -8,7 +8,7 @@ use serde::{Deserialize, Serialize}; #[derive(Clone, Serialize, Deserialize)] struct WebringMember { name: String, - domain: String, + site: String, } #[web::get("/next/{name}")] @@ -18,8 +18,8 @@ async fn next( ) -> impl web::Responder { if let Some((i, _)) = members.iter().enumerate().find(|(_, member)| member.name == *name) { let next_index = (i + 1) % members.len(); - let next_domain = &members[next_index].domain; - let next_url = format!("https://{next_domain}/"); + let next_site = &members[next_index].site; + let next_url = format!("https://{next_site}/"); return Response::PermanentRedirect() .header(header::LOCATION, next_url) @@ -40,8 +40,8 @@ async fn prev( ) -> impl web::Responder { if let Some((i, _)) = members.iter().enumerate().find(|(_, member)| member.name == *name) { let prev_index = if i == 0 { members.len() - 1 } else { i - 1 }; - let prev_domain = &members[prev_index].domain; - let prev_url = format!("https://{prev_domain}/"); + let prev_site = &members[prev_index].site; + let prev_url = format!("https://{prev_site}/"); return Response::PermanentRedirect() .header(header::LOCATION, prev_url) @@ -60,8 +60,8 @@ async fn rand( members: web::types::State>, ) -> impl web::Responder { let rand_index = thread_rng().gen_range(0..members.len()); - let rand_domain = &members[rand_index].domain; - let rand_url = format!("https://{rand_domain}/"); + let rand_site = &members[rand_index].site; + let rand_url = format!("https://{rand_site}/"); Response::PermanentRedirect() .header(header::LOCATION, rand_url)