mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-15 01:53:09 +02:00
b875cc9949
* feat: アカウント作成にメールアドレス必須にするオプション
* ui
* fix bug
* fix bug
* fix bug
* 🎨
37 lines
648 B
TypeScript
37 lines
648 B
TypeScript
import $ from 'cafy';
|
|
import define from '../../define';
|
|
import { UserProfiles } from '@/models/index';
|
|
|
|
export const meta = {
|
|
tags: ['users'],
|
|
|
|
requireCredential: false as const,
|
|
|
|
params: {
|
|
emailAddress: {
|
|
validator: $.str
|
|
}
|
|
},
|
|
|
|
res: {
|
|
type: 'object' as const,
|
|
optional: false as const, nullable: false as const,
|
|
properties: {
|
|
available: {
|
|
type: 'boolean' as const,
|
|
optional: false as const, nullable: false as const,
|
|
}
|
|
}
|
|
}
|
|
};
|
|
|
|
export default define(meta, async (ps) => {
|
|
const exist = await UserProfiles.count({
|
|
emailVerified: true,
|
|
email: ps.emailAddress,
|
|
});
|
|
|
|
return {
|
|
available: exist === 0
|
|
};
|
|
});
|