15 lines
		
	
	
		
			261 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			15 lines
		
	
	
		
			261 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
import { SidebarItem } from "@models/sidebarEntry";
 | 
						|
 | 
						|
export default cachedEventHandler(
 | 
						|
	async (ev) => {
 | 
						|
		const si = await SidebarItem.find({});
 | 
						|
		return si.map((a) => a.toObject());
 | 
						|
	},
 | 
						|
	{
 | 
						|
		getKey(event) {
 | 
						|
			return "sidebar";
 | 
						|
		},
 | 
						|
		maxAge: 60 * 10,
 | 
						|
	},
 | 
						|
);
 |