FoundKey/packages/backend/src/server/api/endpoints/export-custom-emojis.ts
Johann150 73d546372e
All checks were successful
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-client Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
refactor: replace import paths containing ../ in API server
This is a big one...
2023-02-19 23:36:15 +01:00

31 lines
752 B
TypeScript

import { createExportCustomEmojisJob } from '@/queue/index.js';
import { HOUR } from '@/const.js';
import define from '@/server/api/define.js';
export const meta = {
secure: true,
requireCredential: true,
limit: {
duration: HOUR,
max: 1,
},
} as const;
export const paramDef = {
type: 'object',
properties: {
ids: {
description: 'Specific emoji IDs to be exported. Non-local emoji will be ignored. If not provided, all local emoji will be exported.',
type: 'array',
items: { type: 'string' },
minItems: 1,
uniqueItems: true,
},
},
required: [],
} as const;
// eslint-disable-next-line import/no-default-export
export default define(meta, paramDef, async (ps, user) => {
createExportCustomEmojisJob(user, ps.ids);
});