mirror of
https://github.com/paricafe/misskey.git
synced 2024-11-27 18:26:43 -06:00
27 lines
475 B
TypeScript
27 lines
475 B
TypeScript
|
import rndstr from 'rndstr';
|
||
|
import RegistrationTicket from '../../../../models/registration-tickets';
|
||
|
|
||
|
export const meta = {
|
||
|
desc: {
|
||
|
ja: '招待コードを発行します。'
|
||
|
},
|
||
|
|
||
|
requireCredential: true,
|
||
|
requireAdmin: true,
|
||
|
|
||
|
params: {}
|
||
|
};
|
||
|
|
||
|
export default (params: any) => new Promise(async (res, rej) => {
|
||
|
const code = rndstr({ length: 5, chars: '0-9' });
|
||
|
|
||
|
await RegistrationTicket.insert({
|
||
|
createdAt: new Date(),
|
||
|
code: code
|
||
|
});
|
||
|
|
||
|
res({
|
||
|
code: code
|
||
|
});
|
||
|
});
|