1 Commits

Author SHA1 Message Date
2d558eb17d Update dependency react-router-dom to ^7.8.2
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
2025-08-27 00:26:55 +00:00
7 changed files with 45 additions and 33 deletions

View File

@@ -137,10 +137,8 @@ function UsersTable(p: {
<GridActionsCellItem
icon={<SaveIcon />}
label="Save"
material={{
sx: {
color: 'primary.main',
},
sx={{
color: "primary.main",
}}
onClick={handleSaveClick(id)}
/>,

View File

@@ -34,16 +34,18 @@ impl AccommodationRequest {
}
accommodation.name = self.name;
if let Some(d) = &self.description
&& !c.accommodation_description_len.validate(d) {
if let Some(d) = &self.description {
if !c.accommodation_description_len.validate(d) {
return Err(AccommodationListControllerErr::InvalidDescriptionLength.into());
}
}
accommodation.description.clone_from(&self.description);
if let Some(c) = &self.color
&& !lazy_regex::regex!("[a-fA-F0-9]{6}").is_match(c) {
if let Some(c) = &self.color {
if !lazy_regex::regex!("[a-fA-F0-9]{6}").is_match(c) {
return Err(AccommodationListControllerErr::MalformedColor.into());
}
}
accommodation.color.clone_from(&self.color);
accommodation.need_validation = self.need_validation;

View File

@@ -48,20 +48,23 @@ impl CoupleRequest {
}
}
if let Some(husband) = self.husband
&& !members_service::exists(couple.family_id(), husband).await? {
if let Some(husband) = self.husband {
if !members_service::exists(couple.family_id(), husband).await? {
return Err(CoupleControllerErr::HusbandNotExisting.into());
}
}
if let Some(d) = &self.wedding
&& !d.check() {
if let Some(d) = &self.wedding {
if !d.check() {
return Err(CoupleControllerErr::MalformedDateOfWedding.into());
}
}
if let Some(d) = &self.divorce
&& !d.check() {
if let Some(d) = &self.divorce {
if !d.check() {
return Err(CoupleControllerErr::MalformedDateOfDivorce.into());
}
}
couple.set_wife(self.wife);
couple.set_husband(self.husband);

View File

@@ -95,10 +95,11 @@ fn check_opt_str_val(
c: SizeConstraint,
err: MemberControllerErr,
) -> anyhow::Result<()> {
if let Some(v) = val
&& !c.validate(v) {
if let Some(v) = val {
if !c.validate(v) {
return Err(err.into());
}
}
Ok(())
}
@@ -150,10 +151,11 @@ impl MemberRequest {
MemberControllerErr::MalformedEmailAddress,
)?;
if let Some(mail) = &self.email
&& !mailchecker::is_valid(mail) {
if let Some(mail) = &self.email {
if !mailchecker::is_valid(mail) {
return Err(MemberControllerErr::InvalidEmailAddress.into());
}
}
check_opt_str_val(
&self.phone,
@@ -185,20 +187,23 @@ impl MemberRequest {
MemberControllerErr::MalformedCountry,
)?;
if let Some(c) = &self.country
&& !countries_utils::is_code_valid(c) {
if let Some(c) = &self.country {
if !countries_utils::is_code_valid(c) {
return Err(MemberControllerErr::InvalidCountryCode.into());
}
}
if let Some(d) = &self.birth
&& !d.check() {
if let Some(d) = &self.birth {
if !d.check() {
return Err(MemberControllerErr::MalformedDateOfBirth.into());
}
}
if let Some(d) = &self.death
&& !d.check() {
if let Some(d) = &self.death {
if !d.check() {
return Err(MemberControllerErr::MalformedDateOfDeath.into());
}
}
check_opt_str_val(
&self.note,
@@ -216,10 +221,11 @@ impl MemberRequest {
}
}
if let Some(father) = self.father
&& !members_service::exists(member.family_id(), father).await? {
if let Some(father) = self.father {
if !members_service::exists(member.family_id(), father).await? {
return Err(MemberControllerErr::FatherNotExisting.into());
}
}
member.first_name = self.first_name;
member.last_name = self.last_name;

View File

@@ -36,15 +36,16 @@ async fn get_photo(id: &PhotoIdPath, full_size: bool, req: HttpRequest) -> HttpR
};
// Check if an upload is un-necessary
if let Some(c) = req.headers().get(header::IF_NONE_MATCH)
&& c.to_str().unwrap_or("") == hash {
if let Some(c) = req.headers().get(header::IF_NONE_MATCH) {
if c.to_str().unwrap_or("") == hash {
return Ok(HttpResponse::NotModified().finish());
}
}
if let Some(c) = req.headers().get(header::IF_MODIFIED_SINCE) {
let date_str = c.to_str().unwrap_or("");
if let Ok(date) = httpdate::parse_http_date(date_str)
&& date
if let Ok(date) = httpdate::parse_http_date(date_str) {
if date
.add(Duration::from_secs(1))
.duration_since(UNIX_EPOCH)
.unwrap()
@@ -53,6 +54,7 @@ async fn get_photo(id: &PhotoIdPath, full_size: bool, req: HttpRequest) -> HttpR
{
return Ok(HttpResponse::NotModified().finish());
}
}
}
let bytes = s3_connection::get_file(&match full_size {

View File

@@ -149,10 +149,11 @@ pub mod loop_detection {
impl LoopStack<'_> {
pub fn contains(&self, id: MemberID) -> bool {
if let Some(ls) = &self.prev
&& ls.contains(id) {
if let Some(ls) = &self.prev {
if ls.contains(id) {
return true;
}
}
self.curr == id
}

View File

@@ -64,7 +64,7 @@ fn redis_key(state: &str) -> String {
format!("oidc-state-{state}")
}
async fn load_provider_info(prov_id: &str) -> anyhow::Result<OpenIDClient<'_>> {
async fn load_provider_info(prov_id: &str) -> anyhow::Result<OpenIDClient> {
let prov = AppConfig::get()
.openid_providers()
.into_iter()