mirror of
https://iceshrimp.dev/crimekillz/trashposs
synced 2024-11-22 17:03:49 +01:00
Add endpoint
This commit is contained in:
parent
ed2ddd2cca
commit
0ed6d30f5e
32
packages/backend/src/server/api/endpoints/custom-motd.ts
Normal file
32
packages/backend/src/server/api/endpoints/custom-motd.ts
Normal file
@ -0,0 +1,32 @@
|
||||
// import { IsNull } from 'typeorm';
|
||||
import { fetchMeta } from '@/misc/fetch-meta.js';
|
||||
import define from '../define.js';
|
||||
|
||||
export const meta = {
|
||||
tags: ['meta'],
|
||||
|
||||
requireCredential: false,
|
||||
requireCredentialPrivateMode: true,
|
||||
|
||||
res: {
|
||||
type: 'array',
|
||||
optional: false, nullable: false,
|
||||
items: {
|
||||
type: 'string',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
},
|
||||
} as const;
|
||||
|
||||
export const paramDef = {
|
||||
type: 'array',
|
||||
properties: {},
|
||||
required: [],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
export default define(meta, paramDef, async () => {
|
||||
const meta = await fetchMeta();
|
||||
const motd = await Promise.all(meta.customMOTD.map(x => x));
|
||||
return motd;
|
||||
});
|
Loading…
Reference in New Issue
Block a user