hippofish/packages/backend/src/server/api/endpoints/custom-splash-icons.ts

34 lines
647 B
TypeScript
Raw Normal View History

2022-07-27 19:25:30 +02:00
// import { IsNull } from 'typeorm';
2023-01-13 05:40:33 +01:00
import { fetchMeta } from "@/misc/fetch-meta.js";
import define from "../define.js";
2022-07-27 19:25:30 +02:00
export const meta = {
2023-01-13 05:40:33 +01:00
tags: ["meta"],
2022-07-27 19:25:30 +02:00
requireCredential: false,
requireCredentialPrivateMode: true,
res: {
2023-01-13 05:40:33 +01:00
type: "array",
optional: false,
nullable: false,
2022-07-27 19:25:30 +02:00
items: {
2023-01-13 05:40:33 +01:00
type: "string",
optional: false,
nullable: false,
2022-07-27 19:25:30 +02:00
},
},
} as const;
export const paramDef = {
2023-01-13 05:40:33 +01:00
type: "object",
2022-07-27 19:25:30 +02:00
properties: {},
required: [],
} as const;
export default define(meta, paramDef, async () => {
const meta = await fetchMeta();
2023-01-13 05:40:33 +01:00
const icons = await Promise.all(meta.customSplashIcons.map((x) => x));
2022-07-27 19:25:30 +02:00
return icons;
});