revert: Revert changes to asklyphe-frontend/src/routes/admin.rs
	
		
			
	
		
	
	
		
	
		
			All checks were successful
		
		
	
	
		
			
				
	
				/ build-all-services (push) Successful in 9m51s
				
			
		
		
	
	
				
					
				
			
		
			All checks were successful
		
		
	
	/ build-all-services (push) Successful in 9m51s
				
			This commit is contained in:
		
							parent
							
								
									95ba628934
								
							
						
					
					
						commit
						1c6edf2039
					
				
					 1 changed files with 33 additions and 2 deletions
				
			
		|  | @ -343,14 +343,45 @@ pub async fn admin_invitecode( | |||
|         } | ||||
|         
 | ||||
|         let active_codes = match list_invite_codes(nats.clone(), token.clone(), false).await { | ||||
|             Ok(v) => v, | ||||
|             Ok(mut v) => { | ||||
|                 for v in &mut v { | ||||
|                     if let Some(used_by) = &v.used_by { | ||||
|                         if used_by.len() > 32 { | ||||
|                             v.used_by = Some(format!("{}...", &used_by[0..32])); | ||||
|                         } | ||||
|                     } | ||||
| 
 | ||||
|                     if v.creator.len() > 32 { | ||||
|                         v.creator = format!("{}...", &v.creator[0..32]); | ||||
|                     } | ||||
|                 } | ||||
| 
 | ||||
|                 v | ||||
|             }, | ||||
|             Err(e) => { | ||||
|                 return e.into_response(); | ||||
|             } | ||||
|         }; | ||||
|         
 | ||||
|         let used_codes = match list_invite_codes(nats.clone(), token.clone(), true).await { | ||||
|             Ok(v) => v.into_iter().map(|mut v| if v.used_at.is_none() { v.used_at = Some(String::from("unset")); v } else { v }).collect(), | ||||
|             Ok(v) => v.into_iter().map(|mut v| { | ||||
|                 if let Some(used_by) = &v.used_by { | ||||
|                     if used_by.len() > 32 { | ||||
|                         v.used_by = Some(format!("{}...", &used_by[0..32])); | ||||
|                     } | ||||
|                 } | ||||
| 
 | ||||
|                 if v.creator.len() > 32 { | ||||
|                     v.creator = format!("{}...", &v.creator[0..32]); | ||||
|                 } | ||||
| 
 | ||||
|                 if v.used_at.is_none() { | ||||
|                     v.used_at = Some(String::from("unset")); | ||||
|                     v | ||||
|                 } else { | ||||
|                     v | ||||
|                 } | ||||
|             }).collect(), | ||||
|             Err(e) => { | ||||
|                 return e.into_response(); | ||||
|             } | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue