mirror of https://github.com/halo-dev/halo
				
				
				
			
		
			
				
	
	
		
			24 lines
		
	
	
		
			508 B
		
	
	
	
		
			TypeScript
		
	
	
			
		
		
	
	
			24 lines
		
	
	
		
			508 B
		
	
	
	
		
			TypeScript
		
	
	
| import type { GlobalInfo } from "@/types";
 | |
| import { useQuery } from "@tanstack/vue-query";
 | |
| import axios from "axios";
 | |
| 
 | |
| export function useGlobalInfoFetch() {
 | |
|   const { data } = useQuery<GlobalInfo>({
 | |
|     queryKey: ["globalinfo"],
 | |
|     queryFn: async () => {
 | |
|       const { data } = await axios.get<GlobalInfo>(
 | |
|         `${import.meta.env.VITE_API_URL}/actuator/globalinfo`,
 | |
|         {
 | |
|           withCredentials: true,
 | |
|         }
 | |
|       );
 | |
| 
 | |
|       return data;
 | |
|     },
 | |
|   });
 | |
| 
 | |
|   return {
 | |
|     globalInfo: data,
 | |
|   };
 | |
| }
 |