mirror of
				https://codeberg.org/yeentown/barkey.git
				synced 2025-11-03 23:14:13 +00:00 
			
		
		
		
	perf(backend): allow get for some endpoints
This commit is contained in:
		
							parent
							
								
									1b1f82a2e2
								
							
						
					
					
						commit
						a1327fa9e1
					
				
					 5 changed files with 7 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -9,6 +9,8 @@ export const meta = {
 | 
			
		|||
	tags: ['meta'],
 | 
			
		||||
 | 
			
		||||
	requireCredential: false,
 | 
			
		||||
	allowGet: true,
 | 
			
		||||
	cacheSec: 60 * 1,
 | 
			
		||||
} as const;
 | 
			
		||||
 | 
			
		||||
export const paramDef = {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -26,6 +26,8 @@ export const meta = {
 | 
			
		|||
	tags: ['hashtags'],
 | 
			
		||||
 | 
			
		||||
	requireCredential: false,
 | 
			
		||||
	allowGet: true,
 | 
			
		||||
	cacheSec: 60 * 1,
 | 
			
		||||
 | 
			
		||||
	res: {
 | 
			
		||||
		type: 'array',
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -73,7 +73,7 @@ let fetching = $ref(true);
 | 
			
		|||
onMounted(async () => {
 | 
			
		||||
	const [_stats, _onlineUsersCount] = await Promise.all([
 | 
			
		||||
		os.api('stats', {}),
 | 
			
		||||
		os.api('get-online-users-count').then(res => res.count),
 | 
			
		||||
		os.apiGet('get-online-users-count').then(res => res.count),
 | 
			
		||||
	]);
 | 
			
		||||
	stats = _stats;
 | 
			
		||||
	onlineUsersCount = _onlineUsersCount;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -40,7 +40,7 @@ const { widgetProps, configure } = useWidgetPropsManager(name,
 | 
			
		|||
const onlineUsersCount = ref(0);
 | 
			
		||||
 | 
			
		||||
const tick = () => {
 | 
			
		||||
	os.api('get-online-users-count').then(res => {
 | 
			
		||||
	os.apiGet('get-online-users-count').then(res => {
 | 
			
		||||
		onlineUsersCount.value = res.count;
 | 
			
		||||
	});
 | 
			
		||||
};
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -53,7 +53,7 @@ const stats = ref([]);
 | 
			
		|||
const fetching = ref(true);
 | 
			
		||||
 | 
			
		||||
const fetch = () => {
 | 
			
		||||
	os.api('hashtags/trend').then(res => {
 | 
			
		||||
	os.apiGet('hashtags/trend').then(res => {
 | 
			
		||||
		stats.value = res;
 | 
			
		||||
		fetching.value = false;
 | 
			
		||||
	});
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue