mirror of
				https://github.com/mealie-recipes/mealie.git
				synced 2025-11-03 18:53:17 -05:00 
			
		
		
		
	
		
			
	
	
		
			16 lines
		
	
	
		
			441 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
		
		
			
		
	
	
			16 lines
		
	
	
		
			441 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| 
								 | 
							
								import { NuxtAxiosInstance } from "@nuxtjs/axios";
							 | 
						||
| 
								 | 
							
								import { alert } from "~/composables/use-toast";
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								export default function ({ $axios }: { $axios: NuxtAxiosInstance }) {
							 | 
						||
| 
								 | 
							
								  $axios.onResponse((response) => {
							 | 
						||
| 
								 | 
							
								    if (response.data.message) {
							 | 
						||
| 
								 | 
							
								      alert.info(response.data.message);
							 | 
						||
| 
								 | 
							
								    }
							 | 
						||
| 
								 | 
							
								  });
							 | 
						||
| 
								 | 
							
								  $axios.onError((error) => {
							 | 
						||
| 
								 | 
							
								    if (error.response?.data?.detail?.message) {
							 | 
						||
| 
								 | 
							
								      alert.error(error.response.data.detail.message);
							 | 
						||
| 
								 | 
							
								    }
							 | 
						||
| 
								 | 
							
								  });
							 | 
						||
| 
								 | 
							
								}
							 |