forked from open-webui/open-webui
		
	feat: show error toast if trying to download db on external db
This commit is contained in:
		
							parent
							
								
									e91a49c455
								
							
						
					
					
						commit
						47a33acfeb
					
				
					 4 changed files with 21 additions and 6 deletions
				
			
		| 
						 | 
				
			
			@ -83,9 +83,9 @@ export const downloadDatabase = async (token: string) => {
 | 
			
		|||
			Authorization: `Bearer ${token}`
 | 
			
		||||
		}
 | 
			
		||||
	})
 | 
			
		||||
		.then((response) => {
 | 
			
		||||
		.then(async (response) => {
 | 
			
		||||
			if (!response.ok) {
 | 
			
		||||
				throw new Error('Network response was not ok');
 | 
			
		||||
				throw await response.json();
 | 
			
		||||
			}
 | 
			
		||||
			return response.blob();
 | 
			
		||||
		})
 | 
			
		||||
| 
						 | 
				
			
			@ -100,7 +100,11 @@ export const downloadDatabase = async (token: string) => {
 | 
			
		|||
		})
 | 
			
		||||
		.catch((err) => {
 | 
			
		||||
			console.log(err);
 | 
			
		||||
			error = err;
 | 
			
		||||
			error = err.detail;
 | 
			
		||||
			return null;
 | 
			
		||||
		});
 | 
			
		||||
 | 
			
		||||
	if (error) {
 | 
			
		||||
		throw error;
 | 
			
		||||
	}
 | 
			
		||||
};
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue