mirror of
https://iceshrimp.dev/iceshrimp/iceshrimp
synced 2024-12-28 13:38:06 +09:00
b666128ddc
Closes #2357
28 lines
524 B
TypeScript
28 lines
524 B
TypeScript
import rndstr from 'rndstr';
|
|
import RegistrationTicket from '../../../../models/registration-tickets';
|
|
import define from '../../define';
|
|
|
|
export const meta = {
|
|
desc: {
|
|
'ja-JP': '招待コードを発行します。'
|
|
},
|
|
|
|
requireCredential: true,
|
|
requireModerator: true,
|
|
|
|
params: {}
|
|
};
|
|
|
|
export default define(meta, (ps) => new Promise(async (res, rej) => {
|
|
const code = rndstr({ length: 5, chars: '0-9' });
|
|
|
|
await RegistrationTicket.insert({
|
|
createdAt: new Date(),
|
|
code: code
|
|
});
|
|
|
|
res({
|
|
code: code
|
|
});
|
|
}));
|