make mock packages reusable

This commit is contained in:
neil 2022-11-27 18:53:51 +08:00
parent 1cb37a8797
commit acafea3842

View file

@ -6,9 +6,7 @@
* * make cors work with api.tea.xyz/v1 * * make cors work with api.tea.xyz/v1
*/ */
import type { Package } from '../types'; import type { Package } from '../types';
const packages: Package[] = [
export async function getPackages(): Promise<Package[]> {
const packages: Package[] = [
{ {
slug: 'mesonbuild_com', slug: 'mesonbuild_com',
homepage: 'https://mesonbuild.com', homepage: 'https://mesonbuild.com',
@ -149,6 +147,9 @@ export async function getPackages(): Promise<Package[]> {
thumb_image_url: 'https://tea.xyz/Images/packages/tea_xyz_gx_cc.jpg', thumb_image_url: 'https://tea.xyz/Images/packages/tea_xyz_gx_cc.jpg',
installs: 0 installs: 0
} }
]; ];
export async function getPackages(): Promise<Package[]> {
return packages; return packages;
} }