 Stefan Melmuk
					
					1 year ago
						Stefan Melmuk
					
					1 year ago
					
						
							committed by
							
								 GitHub
								GitHub
							
						 
					
				 
				
			 
		 
		
			
				
					
					No known key found for this signature in database
					
						
							GPG Key ID: B5690EEEBB952194
						
					
				
			
		
		
		
	
		
			
				 1 changed files with 
9 additions and 
0 deletions
			 
			
		 
		
			
				- 
					
					
					 
					src/db/models/organization.rs
				
				
				
					
						
							
								
									
	
		
			
				
					|  |  | @ -316,6 +316,7 @@ impl Organization { | 
			
		
	
		
			
				
					|  |  |  |         UserOrganization::delete_all_by_organization(&self.uuid, conn).await?; | 
			
		
	
		
			
				
					|  |  |  |         OrgPolicy::delete_all_by_organization(&self.uuid, conn).await?; | 
			
		
	
		
			
				
					|  |  |  |         Group::delete_all_by_organization(&self.uuid, conn).await?; | 
			
		
	
		
			
				
					|  |  |  |         OrganizationApiKey::delete_all_by_organization(&self.uuid, conn).await?; | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |         db_run! { conn: { | 
			
		
	
		
			
				
					|  |  |  |             diesel::delete(organizations::table.filter(organizations::uuid.eq(self.uuid))) | 
			
		
	
	
		
			
				
					|  |  | @ -886,6 +887,14 @@ impl OrganizationApiKey { | 
			
		
	
		
			
				
					|  |  |  |                 .ok().from_db() | 
			
		
	
		
			
				
					|  |  |  |         }} | 
			
		
	
		
			
				
					|  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |     pub async fn delete_all_by_organization(org_uuid: &str, conn: &mut DbConn) -> EmptyResult { | 
			
		
	
		
			
				
					|  |  |  |         db_run! { conn: { | 
			
		
	
		
			
				
					|  |  |  |             diesel::delete(organization_api_key::table.filter(organization_api_key::org_uuid.eq(org_uuid))) | 
			
		
	
		
			
				
					|  |  |  |                 .execute(conn) | 
			
		
	
		
			
				
					|  |  |  |                 .map_res("Error removing organization api key from organization") | 
			
		
	
		
			
				
					|  |  |  |         }} | 
			
		
	
		
			
				
					|  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  | } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | #[cfg(test)] | 
			
		
	
	
		
			
				
					|  |  | 
 |